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

Unified Diff: src/utils/SkDeferredCanvas.cpp

Issue 831253002: Revert of Revert of move remaining virtual draw methods to onDraw (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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/pipe/SkGPipeWrite.cpp ('k') | src/utils/SkDumpCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkDeferredCanvas.cpp
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index 5083cf7e42f1b5d8b79c95d351931f10c8616981..a41b3ab3b4af058699cdd947e7c29a3df60abc36 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -754,7 +754,7 @@
this->recordedDrawCommand();
}
-void SkDeferredCanvas::drawPaint(const SkPaint& paint) {
+void SkDeferredCanvas::onDrawPaint(const SkPaint& paint) {
if (fDeferredDrawing && this->isFullFrame(NULL, &paint) &&
isPaintOpaque(&paint)) {
this->getDeferredDevice()->skipPendingCommands();
@@ -764,20 +764,20 @@
this->recordedDrawCommand();
}
-void SkDeferredCanvas::drawPoints(PointMode mode, size_t count,
- const SkPoint pts[], const SkPaint& paint) {
+void SkDeferredCanvas::onDrawPoints(PointMode mode, size_t count,
+ const SkPoint pts[], const SkPaint& paint) {
AutoImmediateDrawIfNeeded autoDraw(*this, &paint);
this->drawingCanvas()->drawPoints(mode, count, pts, paint);
this->recordedDrawCommand();
}
-void SkDeferredCanvas::drawOval(const SkRect& rect, const SkPaint& paint) {
+void SkDeferredCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) {
AutoImmediateDrawIfNeeded autoDraw(*this, &paint);
this->drawingCanvas()->drawOval(rect, paint);
this->recordedDrawCommand();
}
-void SkDeferredCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
+void SkDeferredCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
if (fDeferredDrawing && this->isFullFrame(&rect, &paint) &&
isPaintOpaque(&paint)) {
this->getDeferredDevice()->skipPendingCommands();
@@ -788,7 +788,7 @@
this->recordedDrawCommand();
}
-void SkDeferredCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
+void SkDeferredCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
if (rrect.isRect()) {
this->SkDeferredCanvas::drawRect(rrect.getBounds(), paint);
} else if (rrect.isOval()) {
@@ -807,14 +807,14 @@
this->recordedDrawCommand();
}
-void SkDeferredCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
+void SkDeferredCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
AutoImmediateDrawIfNeeded autoDraw(*this, &paint);
this->drawingCanvas()->drawPath(path, paint);
this->recordedDrawCommand();
}
-void SkDeferredCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar left,
- SkScalar top, const SkPaint* paint) {
+void SkDeferredCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar left,
+ SkScalar top, const SkPaint* paint) {
SkRect bitmapRect = SkRect::MakeXYWH(left, top,
SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height()));
if (fDeferredDrawing &&
@@ -828,11 +828,9 @@
this->recordedDrawCommand();
}
-void SkDeferredCanvas::drawBitmapRectToRect(const SkBitmap& bitmap,
- const SkRect* src,
- const SkRect& dst,
- const SkPaint* paint,
- DrawBitmapRectFlags flags) {
+void SkDeferredCanvas::onDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
+ const SkRect& dst,
+ const SkPaint* paint, DrawBitmapRectFlags flags) {
if (fDeferredDrawing &&
this->isFullFrame(&dst, paint) &&
isPaintOpaque(paint, &bitmap)) {
@@ -844,9 +842,9 @@
this->recordedDrawCommand();
}
-void SkDeferredCanvas::drawBitmapNine(const SkBitmap& bitmap,
- const SkIRect& center, const SkRect& dst,
- const SkPaint* paint) {
+void SkDeferredCanvas::onDrawBitmapNine(const SkBitmap& bitmap,
+ const SkIRect& center, const SkRect& dst,
+ const SkPaint* paint) {
// TODO: reset recording canvas if paint+bitmap is opaque and clip rect
// covers canvas entirely and dst covers canvas entirely
AutoImmediateDrawIfNeeded autoDraw(*this, &bitmap, paint);
@@ -854,8 +852,8 @@
this->recordedDrawCommand();
}
-void SkDeferredCanvas::drawSprite(const SkBitmap& bitmap, int left, int top,
- const SkPaint* paint) {
+void SkDeferredCanvas::onDrawSprite(const SkBitmap& bitmap, int left, int top,
+ const SkPaint* paint) {
SkRect bitmapRect = SkRect::MakeXYWH(
SkIntToScalar(left),
SkIntToScalar(top),
@@ -913,12 +911,12 @@
this->recordedDrawCommand();
}
-void SkDeferredCanvas::drawVertices(VertexMode vmode, int vertexCount,
- const SkPoint vertices[],
- const SkPoint texs[],
- const SkColor colors[], SkXfermode* xmode,
- const uint16_t indices[], int indexCount,
- const SkPaint& paint) {
+void SkDeferredCanvas::onDrawVertices(VertexMode vmode, int vertexCount,
+ const SkPoint vertices[],
+ const SkPoint texs[],
+ const SkColor colors[], SkXfermode* xmode,
+ const uint16_t indices[], int indexCount,
+ const SkPaint& paint) {
AutoImmediateDrawIfNeeded autoDraw(*this, &paint);
this->drawingCanvas()->drawVertices(vmode, vertexCount, vertices, texs, colors, xmode,
indices, indexCount, paint);
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | src/utils/SkDumpCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698