Added dev- & canv- prefixes to Ganesh bounding boxes to indicate coordinate space
http://codereview.appspot.com/6457061/
git-svn-id: http://skia.googlecode.com/svn/trunk@4856 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp
index ab04bb4..576a5bd 100644
--- a/src/gpu/GrTextContext.cpp
+++ b/src/gpu/GrTextContext.cpp
@@ -70,6 +70,20 @@
fDrawTarget = NULL;
}
+namespace {
+
+// 'rect' enters in canvas coordinates and leaves in device coordinates
+void canvas_to_device(SkRect* rect, const SkIPoint& origin) {
+ GrAssert(NULL != rect);
+
+ rect->fLeft -= SkIntToScalar(origin.fX);
+ rect->fTop -= SkIntToScalar(origin.fY);
+ rect->fRight -= SkIntToScalar(origin.fX);
+ rect->fBottom -= SkIntToScalar(origin.fY);
+}
+
+};
+
GrTextContext::GrTextContext(GrContext* context,
const GrPaint& paint,
const GrMatrix* extMatrix) : fPaint(paint) {
@@ -88,8 +102,7 @@
const GrClipData* clipData = context->getClip();
GrRect conservativeBound = clipData->fClipStack->getConservativeBounds();
- conservativeBound.offset(SkIntToScalar(-clipData->fOrigin.fX),
- SkIntToScalar(-clipData->fOrigin.fY));
+ canvas_to_device(&conservativeBound, clipData->fOrigin);
if (!fExtMatrix.isIdentity()) {
GrMatrix inverse;