diff options
author | Matt Sarett <msarett@google.com> | 2016-11-28 18:41:01 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-29 18:49:36 +0000 |
commit | 25d6c8325a4f8ebca30eb01b91123dfd8c57b87b (patch) | |
tree | f2d7d1ebf311691450e4eb7077e6b431ad4722a4 | |
parent | f7657e9a2a2be2c892ece03fd65d0f85f033bc6d (diff) |
Remove duplicate storage of fCanvas in SkOverdrawCanvas
BUG=skia:
Change-Id: I06827e286b13823fdd89090a75fc63467c9a74e9
Reviewed-on: https://skia-review.googlesource.com/5294
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
-rw-r--r-- | src/core/SkOverdrawCanvas.cpp | 41 | ||||
-rw-r--r-- | src/core/SkOverdrawCanvas.h | 1 |
2 files changed, 20 insertions, 22 deletions
diff --git a/src/core/SkOverdrawCanvas.cpp b/src/core/SkOverdrawCanvas.cpp index 9e257312b8..ac6b110d75 100644 --- a/src/core/SkOverdrawCanvas.cpp +++ b/src/core/SkOverdrawCanvas.cpp @@ -38,7 +38,6 @@ private: SkOverdrawCanvas::SkOverdrawCanvas(SkCanvas* canvas) : INHERITED(canvas->onImageInfo().width(), canvas->onImageInfo().height()) - , fCanvas(canvas) { // Non-drawing calls that SkOverdrawCanvas does not override (translate, save, etc.) // will pass through to the input canvas. @@ -170,46 +169,46 @@ void SkOverdrawCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScal void SkOverdrawCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode blendMode, const SkPaint&) { - fCanvas->onDrawPatch(cubics, colors, texCoords, blendMode, fPaint); + fList[0]->onDrawPatch(cubics, colors, texCoords, blendMode, fPaint); } void SkOverdrawCanvas::onDrawPaint(const SkPaint& paint) { if (0 == paint.getColor() && !paint.getColorFilter() && !paint.getShader()) { // This is a clear, ignore it. } else { - fCanvas->onDrawPaint(this->overdrawPaint(paint)); + fList[0]->onDrawPaint(this->overdrawPaint(paint)); } } void SkOverdrawCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) { - fCanvas->onDrawRect(rect, this->overdrawPaint(paint)); + fList[0]->onDrawRect(rect, this->overdrawPaint(paint)); } void SkOverdrawCanvas::onDrawRegion(const SkRegion& region, const SkPaint& paint) { - fCanvas->onDrawRegion(region, this->overdrawPaint(paint)); + fList[0]->onDrawRegion(region, this->overdrawPaint(paint)); } void SkOverdrawCanvas::onDrawOval(const SkRect& oval, const SkPaint& paint) { - fCanvas->onDrawOval(oval, this->overdrawPaint(paint)); + fList[0]->onDrawOval(oval, this->overdrawPaint(paint)); } void SkOverdrawCanvas::onDrawArc(const SkRect& arc, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const SkPaint& paint) { - fCanvas->onDrawArc(arc, startAngle, sweepAngle, useCenter, this->overdrawPaint(paint)); + fList[0]->onDrawArc(arc, startAngle, sweepAngle, useCenter, this->overdrawPaint(paint)); } void SkOverdrawCanvas::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint) { - fCanvas->onDrawDRRect(outer, inner, this->overdrawPaint(paint)); + fList[0]->onDrawDRRect(outer, inner, this->overdrawPaint(paint)); } void SkOverdrawCanvas::onDrawRRect(const SkRRect& rect, const SkPaint& paint) { - fCanvas->onDrawRRect(rect, this->overdrawPaint(paint)); + fList[0]->onDrawRRect(rect, this->overdrawPaint(paint)); } void SkOverdrawCanvas::onDrawPoints(PointMode mode, size_t count, const SkPoint points[], const SkPaint& paint) { - fCanvas->onDrawPoints(mode, count, points, this->overdrawPaint(paint)); + fList[0]->onDrawPoints(mode, count, points, this->overdrawPaint(paint)); } void SkOverdrawCanvas::onDrawVertices(VertexMode vertexMode, int vertexCount, @@ -217,7 +216,7 @@ void SkOverdrawCanvas::onDrawVertices(VertexMode vertexMode, int vertexCount, const SkColor colors[], SkBlendMode blendMode, const uint16_t indices[], int indexCount, const SkPaint& paint) { - fCanvas->onDrawVertices(vertexMode, vertexCount, vertices, texs, colors, blendMode, indices, + fList[0]->onDrawVertices(vertexMode, vertexCount, vertices, texs, colors, blendMode, indices, indexCount, this->overdrawPaint(paint)); } @@ -231,25 +230,25 @@ void SkOverdrawCanvas::onDrawAtlas(const SkImage* image, const SkRSXform xform[] paintPtr = &storage; } - fCanvas->onDrawAtlas(image, xform, texs, colors, count, mode, cull, paintPtr); + fList[0]->onDrawAtlas(image, xform, texs, colors, count, mode, cull, paintPtr); } void SkOverdrawCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) { - fCanvas->onDrawPath(path, fPaint); + fList[0]->onDrawPath(path, fPaint); } void SkOverdrawCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, const SkPaint*) { - fCanvas->onDrawRect(SkRect::MakeXYWH(x, y, image->width(), image->height()), fPaint); + fList[0]->onDrawRect(SkRect::MakeXYWH(x, y, image->width(), image->height()), fPaint); } void SkOverdrawCanvas::onDrawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst, const SkPaint*, SrcRectConstraint) { - fCanvas->onDrawRect(dst, fPaint); + fList[0]->onDrawRect(dst, fPaint); } void SkOverdrawCanvas::onDrawImageNine(const SkImage*, const SkIRect&, const SkRect& dst, const SkPaint*) { - fCanvas->onDrawRect(dst, fPaint); + fList[0]->onDrawRect(dst, fPaint); } void SkOverdrawCanvas::onDrawImageLattice(const SkImage* image, const Lattice& lattice, @@ -266,26 +265,26 @@ void SkOverdrawCanvas::onDrawImageLattice(const SkImage* image, const Lattice& l SkRect dummy, iterDst; while (iter.next(&dummy, &iterDst)) { - fCanvas->onDrawRect(iterDst, fPaint); + fList[0]->onDrawRect(iterDst, fPaint); } } else { - fCanvas->onDrawRect(dst, fPaint); + fList[0]->onDrawRect(dst, fPaint); } } void SkOverdrawCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, const SkPaint*) { - fCanvas->onDrawRect(SkRect::MakeXYWH(x, y, bitmap.width(), bitmap.height()), fPaint); + fList[0]->onDrawRect(SkRect::MakeXYWH(x, y, bitmap.width(), bitmap.height()), fPaint); } void SkOverdrawCanvas::onDrawBitmapRect(const SkBitmap&, const SkRect*, const SkRect& dst, const SkPaint*, SrcRectConstraint) { - fCanvas->onDrawRect(dst, fPaint); + fList[0]->onDrawRect(dst, fPaint); } void SkOverdrawCanvas::onDrawBitmapNine(const SkBitmap&, const SkIRect&, const SkRect& dst, const SkPaint*) { - fCanvas->onDrawRect(dst, fPaint); + fList[0]->onDrawRect(dst, fPaint); } void SkOverdrawCanvas::onDrawBitmapLattice(const SkBitmap& bitmap, const Lattice& lattice, diff --git a/src/core/SkOverdrawCanvas.h b/src/core/SkOverdrawCanvas.h index 2c5dbc4d81..d3315412f4 100644 --- a/src/core/SkOverdrawCanvas.h +++ b/src/core/SkOverdrawCanvas.h @@ -62,7 +62,6 @@ private: inline SkPaint overdrawPaint(const SkPaint& paint); - SkCanvas* fCanvas; SkPaint fPaint; typedef SkNWayCanvas INHERITED; |