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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 1351533004: share code between SkGr and Cacherator (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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 | « src/core/SkImageCacherator.cpp ('k') | 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 bba352569abe80026824e8c0d4435ba2b0c16e1b..63c152144a242ec8b141ae5ce3a2f76f48a0091e 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1065,9 +1065,13 @@ void SkGpuDevice::drawBitmapCommon(const SkDraw& draw,
srcRect = *srcRectPtr;
dstSize = *dstSizePtr;
}
- GrTexture* tex = bitmap.getTexture();
- int width = tex ? tex->width() : bitmap.width();
- int height = tex ? tex->height() : bitmap.height();
+
robertphillips 2015/09/16 16:23:27 It seems like this should be: // Does 'srcRect' c
reed1 2015/09/16 17:03:31 Done.
+ int width, height;
+ {
+ GrTexture* tex = bitmap.getTexture();
+ width = tex ? tex->width() : bitmap.width();
+ height = tex ? tex->height() : bitmap.height();
+ }
if (srcRect.fLeft <= 0 && srcRect.fTop <= 0 &&
srcRect.fRight >= width && srcRect.fBottom >= height) {
constraint = SkCanvas::kFast_SrcRectConstraint;
« no previous file with comments | « src/core/SkImageCacherator.cpp ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698