Loading libs/hwui/VectorDrawable.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -574,7 +574,7 @@ bool Tree::allocateBitmapIfNeeded(Cache& cache, int width, int height) { } bool Tree::canReuseBitmap(Bitmap* bitmap, int width, int height) { return bitmap && width == bitmap->width() && height == bitmap->height(); return bitmap && width <= bitmap->width() && height <= bitmap->height(); } void Tree::onPropertyChanged(TreeProperties* prop) { Loading libs/hwui/VectorDrawable.h +9 −4 Original line number Diff line number Diff line Loading @@ -630,10 +630,15 @@ public: } void setScaledSize(int width, int height) { if (mNonAnimatableProperties.scaledWidth != width || mNonAnimatableProperties.scaledHeight != height) { mNonAnimatableProperties.scaledWidth = width; mNonAnimatableProperties.scaledHeight = height; // If the requested size is bigger than what the bitmap was, then // we increase the bitmap size to match. The width and height // are bound by MAX_CACHED_BITMAP_SIZE. if (mNonAnimatableProperties.scaledWidth < width || mNonAnimatableProperties.scaledHeight < height) { mNonAnimatableProperties.scaledWidth = std::max(width, mNonAnimatableProperties.scaledWidth); mNonAnimatableProperties.scaledHeight = std::max(height, mNonAnimatableProperties.scaledHeight); mNonAnimatablePropertiesDirty = true; mTree->onPropertyChanged(this); } Loading Loading
libs/hwui/VectorDrawable.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -574,7 +574,7 @@ bool Tree::allocateBitmapIfNeeded(Cache& cache, int width, int height) { } bool Tree::canReuseBitmap(Bitmap* bitmap, int width, int height) { return bitmap && width == bitmap->width() && height == bitmap->height(); return bitmap && width <= bitmap->width() && height <= bitmap->height(); } void Tree::onPropertyChanged(TreeProperties* prop) { Loading
libs/hwui/VectorDrawable.h +9 −4 Original line number Diff line number Diff line Loading @@ -630,10 +630,15 @@ public: } void setScaledSize(int width, int height) { if (mNonAnimatableProperties.scaledWidth != width || mNonAnimatableProperties.scaledHeight != height) { mNonAnimatableProperties.scaledWidth = width; mNonAnimatableProperties.scaledHeight = height; // If the requested size is bigger than what the bitmap was, then // we increase the bitmap size to match. The width and height // are bound by MAX_CACHED_BITMAP_SIZE. if (mNonAnimatableProperties.scaledWidth < width || mNonAnimatableProperties.scaledHeight < height) { mNonAnimatableProperties.scaledWidth = std::max(width, mNonAnimatableProperties.scaledWidth); mNonAnimatableProperties.scaledHeight = std::max(height, mNonAnimatableProperties.scaledHeight); mNonAnimatablePropertiesDirty = true; mTree->onPropertyChanged(this); } Loading