am 776dafa8: Merge "Log if a view fails to fit in the drawing cache" into jb-mr1-dev
* commit '776dafa8fe359df77de30b72ffc82d1d99e111c9': Log if a view fails to fit in the drawing cache
This commit is contained in:
@@ -12537,10 +12537,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
final boolean opaque = drawingCacheBackgroundColor != 0 || isOpaque();
|
final boolean opaque = drawingCacheBackgroundColor != 0 || isOpaque();
|
||||||
final boolean use32BitCache = attachInfo != null && attachInfo.mUse32BitDrawingCache;
|
final boolean use32BitCache = attachInfo != null && attachInfo.mUse32BitDrawingCache;
|
||||||
|
|
||||||
if (width <= 0 || height <= 0 ||
|
final int projectedBitmapSize = width * height * (opaque && !use32BitCache ? 2 : 4);
|
||||||
// Projected bitmap size in bytes
|
final int drawingCacheSize =
|
||||||
(width * height * (opaque && !use32BitCache ? 2 : 4) >
|
ViewConfiguration.get(mContext).getScaledMaximumDrawingCacheSize();
|
||||||
ViewConfiguration.get(mContext).getScaledMaximumDrawingCacheSize())) {
|
if (width <= 0 || height <= 0 || projectedBitmapSize > drawingCacheSize) {
|
||||||
|
Log.w(VIEW_LOG_TAG, "View too large to fit into drawing cache, needs "
|
||||||
|
+ projectedBitmapSize + " bytes, only "
|
||||||
|
+ drawingCacheSize + " available");
|
||||||
destroyDrawingCache();
|
destroyDrawingCache();
|
||||||
mCachingFailed = true;
|
mCachingFailed = true;
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user