diff options
author | John Reck <jreck@google.com> | 2011-10-04 17:41:15 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-10-04 17:41:15 -0700 |
commit | 9a05db771f2264b0ae687d0adf51a075183f9498 (patch) | |
tree | c4ceba81eabd71f06bb03e40b5b4cd1f3356fb2c /Source/WebCore | |
parent | 3b9c0bd54383c370c1e7d872751539371b1aef54 (diff) | |
parent | 2c1def4fa6e745a5f5e8d1cafd7b7f49ec571e1d (diff) | |
download | external_webkit-9a05db771f2264b0ae687d0adf51a075183f9498.zip external_webkit-9a05db771f2264b0ae687d0adf51a075183f9498.tar.gz external_webkit-9a05db771f2264b0ae687d0adf51a075183f9498.tar.bz2 |
Merge "Remove m_contentsImage usage"
Diffstat (limited to 'Source/WebCore')
4 files changed, 9 insertions, 7 deletions
diff --git a/Source/WebCore/platform/graphics/android/ImageTexture.h b/Source/WebCore/platform/graphics/android/ImageTexture.h index 7e51d2b..c2ea77c 100644 --- a/Source/WebCore/platform/graphics/android/ImageTexture.h +++ b/Source/WebCore/platform/graphics/android/ImageTexture.h @@ -70,6 +70,7 @@ public: void release(); unsigned int refCount() { return m_refCount; } SkBitmapRef* imageRef() { return m_imageRef; } + SkBitmap* bitmap() { return m_image; } private: diff --git a/Source/WebCore/platform/graphics/android/LayerAndroid.h b/Source/WebCore/platform/graphics/android/LayerAndroid.h index 4ae8bd3..90f4e86 100644 --- a/Source/WebCore/platform/graphics/android/LayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/LayerAndroid.h @@ -57,6 +57,7 @@ namespace android { class DrawExtra; void serializeLayer(WebCore::LayerAndroid* layer, SkWStream* stream); WebCore::LayerAndroid* deserializeLayer(SkStream* stream); +void cleanupImageRefs(WebCore::LayerAndroid* layer); } using namespace android; @@ -266,8 +267,10 @@ public: void setIsIframe(bool isIframe) { m_isIframe = isIframe; } float zValue() const { return m_zValue; } + // ViewStateSerializer friends friend void android::serializeLayer(LayerAndroid* layer, SkWStream* stream); friend LayerAndroid* android::deserializeLayer(SkStream* stream); + friend void android::cleanupImageRefs(LayerAndroid* layer); PaintedSurface* texture() { return m_texture; } void assignTextureTo(LayerAndroid* newTree); @@ -324,16 +327,14 @@ private: float m_anchorPointZ; float m_drawOpacity; - // Note that m_recordingPicture and m_contentsImage are mutually exclusive; + // Note that m_recordingPicture and m_imageRef are mutually exclusive; // m_recordingPicture is used when WebKit is asked to paint the layer's - // content, while m_contentsImage contains an image that we directly + // content, while m_imageRef contains an image that we directly // composite, using the layer's dimensions as a destination rect. // We do this as if the layer only contains an image, directly compositing // it is a much faster method than using m_recordingPicture. SkPicture* m_recordingPicture; - SkBitmap* m_contentsImage; - typedef HashMap<pair<String, int>, RefPtr<AndroidAnimation> > KeyframesMap; KeyframesMap m_animations; diff --git a/Source/WebCore/platform/graphics/android/TilesManager.cpp b/Source/WebCore/platform/graphics/android/TilesManager.cpp index cf66de5..f077d48 100644 --- a/Source/WebCore/platform/graphics/android/TilesManager.cpp +++ b/Source/WebCore/platform/graphics/android/TilesManager.cpp @@ -458,11 +458,11 @@ void TilesManager::showImages() } } -ImageTexture* TilesManager::getTextureForImage(SkBitmapRef* img) +ImageTexture* TilesManager::getTextureForImage(SkBitmapRef* img, bool retain) { android::Mutex::Autolock lock(m_imagesLock); ImageTexture* image = m_images.get(img); - if (image) + if (retain && image) image->retain(); return image; } diff --git a/Source/WebCore/platform/graphics/android/TilesManager.h b/Source/WebCore/platform/graphics/android/TilesManager.h index 071aa88..1549581 100644 --- a/Source/WebCore/platform/graphics/android/TilesManager.h +++ b/Source/WebCore/platform/graphics/android/TilesManager.h @@ -179,7 +179,7 @@ public: } void addImage(SkBitmapRef* img); void removeImage(SkBitmapRef* img); - ImageTexture* getTextureForImage(SkBitmapRef* img); + ImageTexture* getTextureForImage(SkBitmapRef* img, bool retain = true); void showImages(); private: |