Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 1405383002: Remove check for whole image in the cache in SkGpuDevice::shouldTileImage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove unused function Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/SkGr.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index cb532feb6b586790ca142fc09a56967aa15551da..f8b372417eeb03700a16fef63d1d3439cc285d98 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -758,16 +758,12 @@ bool SkGpuDevice::shouldTileImageID(uint32_t imageID, const SkIRect& imageRect,
return true;
}
+ // If the image would only produce 4 tiles of the smaller size, don't bother tiling it.
const size_t area = imageRect.width() * imageRect.height();
if (area < 4 * kBmpSmallTileSize * kBmpSmallTileSize) {
return false;
}
- // if the entire image/bitmap is already in our cache then no reason to tile it
- if (GrIsImageInCache(fContext, imageID, imageRect, nullptr, params)) {
- return false;
- }
-
// At this point we know we could do the draw by uploading the entire bitmap
// as a texture. However, if the texture would be large compared to the
// cache size and we don't require most of it for this draw then tile to
@@ -782,7 +778,8 @@ bool SkGpuDevice::shouldTileImageID(uint32_t imageID, const SkIRect& imageRect,
return false;
}
- // Figure out how much of the src we will need based on the src rect and clipping.
+ // Figure out how much of the src we will need based on the src rect and clipping. Reject if
+ // tiling memory savings would be < 50%.
determine_clipped_src_rect(fRenderTarget, fClip, viewMatrix, imageRect.size(), srcRectPtr,
clippedSubset);
*tileSize = kBmpSmallTileSize; // already know whole bitmap fits in one max sized tile.
« no previous file with comments | « no previous file | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698