Compute clipped src rect once in tiled bitmap draws
R=robertphillips@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/40403002
git-svn-id: http://skia.googlecode.com/svn/trunk@11962 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/gpu/SkGpuDevice.h b/include/gpu/SkGpuDevice.h
index 81e0324..0862514 100644
--- a/include/gpu/SkGpuDevice.h
+++ b/include/gpu/SkGpuDevice.h
@@ -184,13 +184,16 @@
/**
* Helper functions called by drawBitmapCommon. By the time these are called the SkDraw's
- * matrix has already been set on GrContext
+ * matrix, clip, and the device's render target has already been set on GrContext.
*/
+
+ // The tileSize and clippedSrcRect will be valid only if true is returned.
bool shouldTileBitmap(const SkBitmap& bitmap,
const GrTextureParams& sampler,
const SkRect* srcRectPtr,
int maxTileSize,
- int* tileSize) const;
+ int* tileSize,
+ SkIRect* clippedSrcRect) const;
void internalDrawBitmap(const SkBitmap&,
const SkRect&,
const GrTextureParams& params,
@@ -198,6 +201,7 @@
SkCanvas::DrawBitmapRectFlags flags);
void drawTiledBitmap(const SkBitmap& bitmap,
const SkRect& srcRect,
+ const SkIRect& clippedSrcRect,
const GrTextureParams& params,
const SkPaint& paint,
SkCanvas::DrawBitmapRectFlags flags,