Loading libs/hwui/DisplayListCanvas.cpp +21 −0 Original line number Diff line number Diff line Loading @@ -352,6 +352,7 @@ void DisplayListCanvas::drawRoundRect( mDisplayListData->ref(rx); mDisplayListData->ref(ry); mDisplayListData->ref(paint); refBitmapsInShader(paint->value.getShader()); addDrawOp(new (alloc()) DrawRoundRectPropsOp(&left->value, &top->value, &right->value, &bottom->value, &rx->value, &ry->value, &paint->value)); } Loading @@ -366,6 +367,7 @@ void DisplayListCanvas::drawCircle(CanvasPropertyPrimitive* x, CanvasPropertyPri mDisplayListData->ref(y); mDisplayListData->ref(radius); mDisplayListData->ref(paint); refBitmapsInShader(paint->value.getShader()); addDrawOp(new (alloc()) DrawCirclePropsOp(&x->value, &y->value, &radius->value, &paint->value)); } Loading Loading @@ -565,5 +567,24 @@ size_t DisplayListCanvas::addRenderNodeOp(DrawRenderNodeOp* op) { return opIndex; } void DisplayListCanvas::refBitmapsInShader(const SkShader* shader) { if (!shader) return; // If this paint has an SkShader that has an SkBitmap add // it to the bitmap pile SkBitmap bitmap; SkShader::TileMode xy[2]; if (shader->asABitmap(&bitmap, nullptr, xy) == SkShader::kDefault_BitmapType) { refBitmap(bitmap); return; } SkShader::ComposeRec rec; if (shader->asACompose(&rec)) { refBitmapsInShader(rec.fShaderA); refBitmapsInShader(rec.fShaderB); return; } } }; // namespace uirenderer }; // namespace android libs/hwui/DisplayListCanvas.h +2 −0 Original line number Diff line number Diff line Loading @@ -263,6 +263,7 @@ private: size_t addDrawOp(DrawOp* op); size_t addRenderNodeOp(DrawRenderNodeOp* op); void refBitmapsInShader(const SkShader* shader); template<class T> inline const T* refBuffer(const T* srcBuffer, int32_t count) { Loading Loading @@ -311,6 +312,7 @@ private: // replaceValueFor() performs an add if the entry doesn't exist mPaintMap.replaceValueFor(key, cachedPaint); refBitmapsInShader(cachedPaint->getShader()); } return cachedPaint; Loading libs/hwui/OpenGLRenderer.h +0 −16 Original line number Diff line number Diff line Loading @@ -523,22 +523,6 @@ protected: */ inline float getLayerAlpha(const Layer* layer) const; /** * Safely retrieves the ColorFilter from the given Paint. If the paint is * null then null is returned. */ static inline SkColorFilter* getColorFilter(const SkPaint* paint) { return paint ? paint->getColorFilter() : nullptr; } /** * Safely retrieves the Shader from the given Paint. If the paint is * null then null is returned. */ static inline const SkShader* getShader(const SkPaint* paint) { return paint ? paint->getShader() : nullptr; } /** * Set to true to suppress error checks at the end of a frame. */ Loading Loading
libs/hwui/DisplayListCanvas.cpp +21 −0 Original line number Diff line number Diff line Loading @@ -352,6 +352,7 @@ void DisplayListCanvas::drawRoundRect( mDisplayListData->ref(rx); mDisplayListData->ref(ry); mDisplayListData->ref(paint); refBitmapsInShader(paint->value.getShader()); addDrawOp(new (alloc()) DrawRoundRectPropsOp(&left->value, &top->value, &right->value, &bottom->value, &rx->value, &ry->value, &paint->value)); } Loading @@ -366,6 +367,7 @@ void DisplayListCanvas::drawCircle(CanvasPropertyPrimitive* x, CanvasPropertyPri mDisplayListData->ref(y); mDisplayListData->ref(radius); mDisplayListData->ref(paint); refBitmapsInShader(paint->value.getShader()); addDrawOp(new (alloc()) DrawCirclePropsOp(&x->value, &y->value, &radius->value, &paint->value)); } Loading Loading @@ -565,5 +567,24 @@ size_t DisplayListCanvas::addRenderNodeOp(DrawRenderNodeOp* op) { return opIndex; } void DisplayListCanvas::refBitmapsInShader(const SkShader* shader) { if (!shader) return; // If this paint has an SkShader that has an SkBitmap add // it to the bitmap pile SkBitmap bitmap; SkShader::TileMode xy[2]; if (shader->asABitmap(&bitmap, nullptr, xy) == SkShader::kDefault_BitmapType) { refBitmap(bitmap); return; } SkShader::ComposeRec rec; if (shader->asACompose(&rec)) { refBitmapsInShader(rec.fShaderA); refBitmapsInShader(rec.fShaderB); return; } } }; // namespace uirenderer }; // namespace android
libs/hwui/DisplayListCanvas.h +2 −0 Original line number Diff line number Diff line Loading @@ -263,6 +263,7 @@ private: size_t addDrawOp(DrawOp* op); size_t addRenderNodeOp(DrawRenderNodeOp* op); void refBitmapsInShader(const SkShader* shader); template<class T> inline const T* refBuffer(const T* srcBuffer, int32_t count) { Loading Loading @@ -311,6 +312,7 @@ private: // replaceValueFor() performs an add if the entry doesn't exist mPaintMap.replaceValueFor(key, cachedPaint); refBitmapsInShader(cachedPaint->getShader()); } return cachedPaint; Loading
libs/hwui/OpenGLRenderer.h +0 −16 Original line number Diff line number Diff line Loading @@ -523,22 +523,6 @@ protected: */ inline float getLayerAlpha(const Layer* layer) const; /** * Safely retrieves the ColorFilter from the given Paint. If the paint is * null then null is returned. */ static inline SkColorFilter* getColorFilter(const SkPaint* paint) { return paint ? paint->getColorFilter() : nullptr; } /** * Safely retrieves the Shader from the given Paint. If the paint is * null then null is returned. */ static inline const SkShader* getShader(const SkPaint* paint) { return paint ? paint->getShader() : nullptr; } /** * Set to true to suppress error checks at the end of a frame. */ Loading