Separate out natively-texture image/bmp draws from cached-as-texture image/bmp draws
This makes texture-backed images and bitmaps down a new code path. It adds a pinch point via the texture adjuster that will be used to handle copied necessary for different texture targets. It also fixes bugs in the existing code exhibited by recent updates to the bleed GM. The plan is to move the the sw/generator-backed imgs/bmps on to this code path with future changes.
Review URL: https://codereview.chromium.org/1424313010
diff --git a/src/gpu/batches/GrAAFillRectBatch.cpp b/src/gpu/batches/GrAAFillRectBatch.cpp
index 5b22422..9646107 100644
--- a/src/gpu/batches/GrAAFillRectBatch.cpp
+++ b/src/gpu/batches/GrAAFillRectBatch.cpp
@@ -332,6 +332,28 @@
return batch;
}
+GrDrawBatch* Create(GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkMatrix& localMatrix,
+ const SkRect& rect) {
+ SkRect devRect;
+ viewMatrix.mapRect(&devRect, rect);
+ return Create(color, viewMatrix, localMatrix, rect, devRect);
+}
+
+GrDrawBatch* CreateWithLocalRect(GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkRect& rect,
+ const SkRect& localRect) {
+ SkRect devRect;
+ viewMatrix.mapRect(&devRect, rect);
+ SkMatrix localMatrix;
+ if (!localMatrix.setRectToRect(rect, localRect, SkMatrix::kFill_ScaleToFit)) {
+ return nullptr;
+ }
+ return Create(color, viewMatrix, localMatrix, rect, devRect);
+}
+
void Append(GrBatch* origBatch,
GrColor color,
const SkMatrix& viewMatrix,