Revert "If the path is a rect, call drawRect to raster the geometry in SkCanvas::drawPath to get better performance."
This reverts commit r11904
Review URL: https://codereview.chromium.org/35543002
git-svn-id: http://skia.googlecode.com/svn/trunk@11909 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/expectations/gm/ignored-tests.txt b/expectations/gm/ignored-tests.txt
index a0ce719..46c7a31 100644
--- a/expectations/gm/ignored-tests.txt
+++ b/expectations/gm/ignored-tests.txt
@@ -34,11 +34,3 @@
# Added by sugoi for https://codereview.chromium.org/28273005/
imagemagnifier
-# Added by bsalomon as part of https://codereview.chromium.org/23484007/
-# to temporarily ignore slight changes between the way rectangle paths
-# and rectangles render.
-pathopsinverse
-convexpaths
-path-reverse
-inverse_paths
-strokerect
diff --git a/experimental/PdfViewer/SkNulCanvas.h b/experimental/PdfViewer/SkNulCanvas.h
index c43ea82..8ec2d32 100644
--- a/experimental/PdfViewer/SkNulCanvas.h
+++ b/experimental/PdfViewer/SkNulCanvas.h
@@ -55,8 +55,10 @@
virtual void drawPaint(const SkPaint& paint) {}
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint) {}
+ virtual void drawRect(const SkRect& rect, const SkPaint& paint) {}
virtual void drawOval(const SkRect& oval, const SkPaint&) {}
virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) {}
+ virtual void drawPath(const SkPath& path, const SkPaint& paint) {}
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
const SkPaint* paint = NULL) {}
virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
@@ -93,8 +95,6 @@
virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter) {return NULL;}
protected:
- virtual void onDrawRect(const SkRect& rect, const SkPaint& paint) {}
- virtual void onDrawPath(const SkPath& path, const SkPaint& paint) {}
virtual SkCanvas* canvasForDrawIter() {return NULL;}
virtual SkBaseDevice* setDevice(SkBaseDevice* device) {return NULL;}
diff --git a/experimental/SimpleCocoaApp/SimpleApp.mm b/experimental/SimpleCocoaApp/SimpleApp.mm
index 2156209..7dac2a4 100644
--- a/experimental/SimpleCocoaApp/SimpleApp.mm
+++ b/experimental/SimpleCocoaApp/SimpleApp.mm
@@ -135,7 +135,7 @@
}
class PathCanvas : public SkCanvas {
- virtual void onDrawPath(const SkPath& path, const SkPaint& paint) {
+ virtual void drawPath(const SkPath& path, const SkPaint& paint) {
if (nameonly) {
SkDebugf(" %s%d,\n", filename.c_str(), ++count);
return;
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 6869585..dc3953e 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -575,20 +575,16 @@
will be filled or stroked based on the Style in the paint.
@param rect The rect to be drawn
@param paint The paint used to draw the rect
-
- Overriding this function is deprecated. It will be made non-virtual
- soon. Instead override onDrawRect.
*/
- virtual void drawRect(const SkRect& rect, const SkPaint& paint) {
- this->onDrawRect(rect, paint);
- }
+ virtual void drawRect(const SkRect& rect, const SkPaint& paint);
/** Draw the specified rectangle using the specified paint. The rectangle
will be filled or framed based on the Style in the paint.
@param rect The rect to be drawn
@param paint The paint used to draw the rect
*/
- void drawIRect(const SkIRect& rect, const SkPaint& paint) {
+ void drawIRect(const SkIRect& rect, const SkPaint& paint)
+ {
SkRect r;
r.set(rect); // promotes the ints to scalars
this->drawRect(r, paint);
@@ -660,18 +656,8 @@
filled or framed based on the Style in the paint.
@param path The path to be drawn
@param paint The paint used to draw the path
-
- Overriding this function is deprecated. It will be made non-virtual
- soon. Instead override onDrawRect.
*/
- virtual void drawPath(const SkPath& path, const SkPaint& paint) {
- SkRect rect;
- if (path.isRect(&rect) && !path.isInverseFillType()) {
- this->onDrawRect(rect, paint);
- } else {
- this->onDrawPath(path, paint);
- }
- }
+ virtual void drawPath(const SkPath& path, const SkPaint& paint);
/** Draw the specified bitmap, with its top/left corner at (x,y), using the
specified paint, transformed by the current matrix. Note: if the paint
@@ -1048,10 +1034,6 @@
// can perform copy-on-write or invalidate any cached images
void predrawNotify();
- virtual void onDrawRect(const SkRect& rect, const SkPaint& paint);
-
- virtual void onDrawPath(const SkPath& path, const SkPaint& paint);
-
/** DEPRECATED -- use constructor(device)
Marked as 'protected' to avoid new clients using this before we can
diff --git a/include/utils/SkDeferredCanvas.h b/include/utils/SkDeferredCanvas.h
index 052c667..c0613ed 100644
--- a/include/utils/SkDeferredCanvas.h
+++ b/include/utils/SkDeferredCanvas.h
@@ -162,7 +162,10 @@
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint) SK_OVERRIDE;
virtual void drawOval(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
+ virtual void drawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE;
virtual void drawRRect(const SkRRect&, const SkPaint& paint) SK_OVERRIDE;
+ virtual void drawPath(const SkPath& path, const SkPaint& paint)
+ SK_OVERRIDE;
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left,
SkScalar top, const SkPaint* paint)
SK_OVERRIDE;
@@ -231,8 +234,6 @@
};
protected:
- virtual void onDrawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE;
- virtual void onDrawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
virtual SkCanvas* canvasForDrawIter();
DeferredDevice* getDeferredDevice() const;
diff --git a/include/utils/SkDumpCanvas.h b/include/utils/SkDumpCanvas.h
index d3ff9a1..96b45e7 100644
--- a/include/utils/SkDumpCanvas.h
+++ b/include/utils/SkDumpCanvas.h
@@ -93,7 +93,9 @@
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint) SK_OVERRIDE;
virtual void drawOval(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
+ virtual void drawRect(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
virtual void drawRRect(const SkRRect&, const SkPaint& paint) SK_OVERRIDE;
+ virtual void drawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
const SkPaint* paint) SK_OVERRIDE;
virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
@@ -124,10 +126,6 @@
virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE;
virtual void endCommentGroup() SK_OVERRIDE;
-protected:
- virtual void onDrawRect(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
- virtual void onDrawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
-
private:
Dumper* fDumper;
int fNestLevel; // for nesting recursive elements like pictures
diff --git a/include/utils/SkLuaCanvas.h b/include/utils/SkLuaCanvas.h
index b604d3c..c34d134 100644
--- a/include/utils/SkLuaCanvas.h
+++ b/include/utils/SkLuaCanvas.h
@@ -42,7 +42,9 @@
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint) SK_OVERRIDE;
virtual void drawOval(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
+ virtual void drawRect(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
virtual void drawRRect(const SkRRect&, const SkPaint& paint) SK_OVERRIDE;
+ virtual void drawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
const SkPaint* paint) SK_OVERRIDE;
virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
@@ -70,10 +72,6 @@
const SkPaint& paint) SK_OVERRIDE;
virtual void drawData(const void* data, size_t length) SK_OVERRIDE;
-protected:
- virtual void onDrawRect(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
- virtual void onDrawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
-
private:
lua_State* fL;
SkString fFunc;
diff --git a/include/utils/SkNWayCanvas.h b/include/utils/SkNWayCanvas.h
index 6791c51..c48bcab 100644
--- a/include/utils/SkNWayCanvas.h
+++ b/include/utils/SkNWayCanvas.h
@@ -43,7 +43,9 @@
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint&) SK_OVERRIDE;
virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
+ virtual void drawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
+ virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
const SkPaint*) SK_OVERRIDE;
virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
@@ -78,8 +80,6 @@
virtual void endCommentGroup() SK_OVERRIDE;
protected:
- virtual void onDrawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
- virtual void onDrawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
SkTDArray<SkCanvas*> fList;
class Iter;
diff --git a/include/utils/SkProxyCanvas.h b/include/utils/SkProxyCanvas.h
index 54cdc3b..383e532 100644
--- a/include/utils/SkProxyCanvas.h
+++ b/include/utils/SkProxyCanvas.h
@@ -48,7 +48,9 @@
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint) SK_OVERRIDE;
virtual void drawOval(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
+ virtual void drawRect(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
virtual void drawRRect(const SkRRect&, const SkPaint& paint) SK_OVERRIDE;
+ virtual void drawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
virtual void drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar top,
const SkPaint* paint = NULL) SK_OVERRIDE;
virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src,
@@ -83,10 +85,6 @@
virtual SkBounder* setBounder(SkBounder* bounder) SK_OVERRIDE;
virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter) SK_OVERRIDE;
-protected:
- virtual void onDrawRect(const SkRect&, const SkPaint& paint) SK_OVERRIDE;
- virtual void onDrawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
-
private:
SkCanvas* fProxy;
diff --git a/src/core/SkBBoxRecord.cpp b/src/core/SkBBoxRecord.cpp
index 08ae990..1e6c69b 100644
--- a/src/core/SkBBoxRecord.cpp
+++ b/src/core/SkBBoxRecord.cpp
@@ -20,23 +20,23 @@
}
}
-void SkBBoxRecord::onDrawRect(const SkRect& rect, const SkPaint& paint) {
+void SkBBoxRecord::drawRect(const SkRect& rect, const SkPaint& paint) {
if (this->transformBounds(rect, &paint)) {
- INHERITED::onDrawRect(rect, paint);
+ INHERITED::drawRect(rect, paint);
}
}
-void SkBBoxRecord::onDrawPath(const SkPath& path, const SkPaint& paint) {
+void SkBBoxRecord::drawPath(const SkPath& path, const SkPaint& paint) {
if (path.isInverseFillType()) {
// If path is inverse filled, use the current clip bounds as the
// path's device-space bounding box.
SkIRect clipBounds;
if (this->getClipDeviceBounds(&clipBounds)) {
this->handleBBox(SkRect::MakeFromIRect(clipBounds));
- INHERITED::onDrawPath(path, paint);
+ INHERITED::drawPath(path, paint);
}
} else if (this->transformBounds(path.getBounds(), &paint)) {
- INHERITED::onDrawPath(path, paint);
+ INHERITED::drawPath(path, paint);
}
}
diff --git a/src/core/SkBBoxRecord.h b/src/core/SkBBoxRecord.h
index e95ece4..fa8b282 100644
--- a/src/core/SkBBoxRecord.h
+++ b/src/core/SkBBoxRecord.h
@@ -31,6 +31,8 @@
virtual void drawOval(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE;
virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) SK_OVERRIDE;
+ virtual void drawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE;
+ virtual void drawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
virtual void drawPoints(PointMode mode, size_t count, const SkPoint pts[],
const SkPaint& paint) SK_OVERRIDE;
virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
@@ -63,10 +65,6 @@
const SkPaint& paint) SK_OVERRIDE;
virtual void drawPicture(SkPicture& picture) SK_OVERRIDE;
-protected:
- virtual void onDrawRect(const SkRect& rect, const SkPaint& paint) SK_OVERRIDE;
- virtual void onDrawPath(const SkPath& path, const SkPaint& paint) SK_OVERRIDE;
-
private:
/**
* Takes a bounding box in current canvas view space, accounts for stroking and effects, and
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 511f39f..6036186 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1631,7 +1631,7 @@
LOOPER_END
}
-void SkCanvas::onDrawRect(const SkRect& r, const SkPaint& paint) {
+void SkCanvas::drawRect(const SkRect& r, const SkPaint& paint) {
CHECK_SHADER_NOSETCONTEXT(paint);
if (paint.canComputeFastBounds()) {
@@ -1699,7 +1699,7 @@
}
-void SkCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
+void SkCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
CHECK_SHADER_NOSETCONTEXT(paint);
if (!path.isFinite()) {
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index bf7a34e..f7a7633 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -868,7 +868,7 @@
this->validate(initialOffset, size);
}
-void SkPictureRecord::onDrawRect(const SkRect& rect, const SkPaint& paint) {
+void SkPictureRecord::drawRect(const SkRect& rect, const SkPaint& paint) {
// op + paint index + rect
uint32_t size = 2 * kUInt32Size + sizeof(rect);
size_t initialOffset = this->addDraw(DRAW_RECT, &size);
@@ -895,7 +895,7 @@
}
}
-void SkPictureRecord::onDrawPath(const SkPath& path, const SkPaint& paint) {
+void SkPictureRecord::drawPath(const SkPath& path, const SkPaint& paint) {
// op + paint index + path index
uint32_t size = 3 * kUInt32Size;
size_t initialOffset = this->addDraw(DRAW_PATH, &size);
diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h
index 33229cf..d80182c 100644
--- a/src/core/SkPictureRecord.h
+++ b/src/core/SkPictureRecord.h
@@ -53,7 +53,9 @@
virtual void drawPoints(PointMode, size_t count, const SkPoint pts[],
const SkPaint&) SK_OVERRIDE;
virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
+ virtual void drawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
+ virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top,
const SkPaint*) SK_OVERRIDE;
virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src,
@@ -104,10 +106,6 @@
void beginRecording();
void endRecording();
-protected:
- virtual void onDrawRect(const SkRect&, const SkPaint&) SK_OVERRIDE;
- virtual void onDrawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
-
private:
void handleOptimization(int opt);
void recordRestoreOffsetPlaceholder(SkRegion::Op);
diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp
index f14cdac..57d4a0f 100644
--- a/src/pipe/SkGPipeWrite.cpp
+++ b/src/pipe/SkGPipeWrite.cpp
@@ -224,7 +224,9 @@
virtual void drawPoints(PointMode, size_t count, const SkPoint pts[],
const SkPaint&) SK_OVERRIDE;
virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
+ virtual void drawRect(const SkRect& rect, const SkPaint&) SK_OVERRIDE;
virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
+ virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top,
const SkPaint*) SK_OVERRIDE;
virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src,
@@ -262,11 +264,6 @@
* according to slot.
*/
bool shuttleBitmap(const SkBitmap&, int32_t slot);
-
-protected:
- virtual void onDrawRect(const SkRect& rect, const SkPaint&) SK_OVERRIDE;
- virtual void onDrawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
-
private:
enum {
kNoSaveLayer = -1,
@@ -718,7 +715,7 @@
}
}
-void SkGPipeCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
+void SkGPipeCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
NOTIFY_SETUP(this);
this->writePaint(paint);
if (this->needOpBytes(sizeof(SkRect))) {
@@ -736,7 +733,7 @@
}
}
-void SkGPipeCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
+void SkGPipeCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
NOTIFY_SETUP(this);
this->writePaint(paint);
if (this->needOpBytes(path.writeToMemory(NULL))) {
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index bc00ab0..ce5eb5e 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -846,7 +846,7 @@
this->recordedDrawCommand();
}
-void SkDeferredCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
+void SkDeferredCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
if (fDeferredDrawing && this->isFullFrame(&rect, &paint) &&
isPaintOpaque(&paint)) {
this->getDeferredDevice()->skipPendingCommands();
@@ -869,7 +869,7 @@
}
}
-void SkDeferredCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
+void SkDeferredCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
AutoImmediateDrawIfNeeded autoDraw(*this, &paint);
this->drawingCanvas()->drawPath(path, paint);
this->recordedDrawCommand();
diff --git a/src/utils/SkDumpCanvas.cpp b/src/utils/SkDumpCanvas.cpp
index 6658ee2..0e1a232 100644
--- a/src/utils/SkDumpCanvas.cpp
+++ b/src/utils/SkDumpCanvas.cpp
@@ -323,7 +323,7 @@
this->dump(kDrawOval_Verb, &paint, "drawOval(%s)", str.c_str());
}
-void SkDumpCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
+void SkDumpCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
SkString str;
toString(rect, &str);
this->dump(kDrawRect_Verb, &paint, "drawRect(%s)", str.c_str());
@@ -335,7 +335,7 @@
this->dump(kDrawRRect_Verb, &paint, "drawRRect(%s)", str.c_str());
}
-void SkDumpCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
+void SkDumpCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
SkString str;
toString(path, &str);
this->dump(kDrawPath_Verb, &paint, "drawPath(%s)", str.c_str());
diff --git a/src/utils/SkLuaCanvas.cpp b/src/utils/SkLuaCanvas.cpp
index 3b74596..c5ec006 100644
--- a/src/utils/SkLuaCanvas.cpp
+++ b/src/utils/SkLuaCanvas.cpp
@@ -187,7 +187,7 @@
lua.pushPaint(paint, "paint");
}
-void SkLuaCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
+void SkLuaCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
AUTO_LUA("drawRect");
lua.pushRect(rect, "rect");
lua.pushPaint(paint, "paint");
@@ -199,7 +199,7 @@
lua.pushPaint(paint, "paint");
}
-void SkLuaCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
+void SkLuaCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
AUTO_LUA("drawPath");
lua.pushPath(path, "path");
lua.pushPaint(paint, "paint");
diff --git a/src/utils/SkNWayCanvas.cpp b/src/utils/SkNWayCanvas.cpp
index 8075bc4..eeb1bc2 100644
--- a/src/utils/SkNWayCanvas.cpp
+++ b/src/utils/SkNWayCanvas.cpp
@@ -190,7 +190,7 @@
}
}
-void SkNWayCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
+void SkNWayCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawRect(rect, paint);
@@ -204,7 +204,7 @@
}
}
-void SkNWayCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
+void SkNWayCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
Iter iter(fList);
while (iter.next()) {
iter->drawPath(path, paint);
diff --git a/src/utils/SkProxyCanvas.cpp b/src/utils/SkProxyCanvas.cpp
index 3bc9652..f530313 100644
--- a/src/utils/SkProxyCanvas.cpp
+++ b/src/utils/SkProxyCanvas.cpp
@@ -87,7 +87,7 @@
fProxy->drawOval(rect, paint);
}
-void SkProxyCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
+void SkProxyCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
fProxy->drawRect(rect, paint);
}
@@ -95,7 +95,7 @@
fProxy->drawRRect(rrect, paint);
}
-void SkProxyCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
+void SkProxyCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
fProxy->drawPath(path, paint);
}
diff --git a/src/utils/debugger/SkDebugCanvas.cpp b/src/utils/debugger/SkDebugCanvas.cpp
index 41d2683..53b531c 100644
--- a/src/utils/debugger/SkDebugCanvas.cpp
+++ b/src/utils/debugger/SkDebugCanvas.cpp
@@ -363,7 +363,7 @@
addDrawCommand(new SkDrawPaintCommand(paint));
}
-void SkDebugCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
+void SkDebugCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
addDrawCommand(new SkDrawPathCommand(path, paint));
}
@@ -387,7 +387,7 @@
new SkDrawPosTextHCommand(text, byteLength, xpos, constY, paint));
}
-void SkDebugCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
+void SkDebugCanvas::drawRect(const SkRect& rect, const SkPaint& paint) {
// NOTE(chudy): Messing up when renamed to DrawRect... Why?
addDrawCommand(new SkDrawRectCommand(rect, paint));
}
diff --git a/src/utils/debugger/SkDebugCanvas.h b/src/utils/debugger/SkDebugCanvas.h
index 93444ac..7d11662 100644
--- a/src/utils/debugger/SkDebugCanvas.h
+++ b/src/utils/debugger/SkDebugCanvas.h
@@ -189,6 +189,8 @@
virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
+ virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
+
virtual void drawPicture(SkPicture& picture) SK_OVERRIDE;
virtual void drawPoints(PointMode, size_t count, const SkPoint pts[],
@@ -201,6 +203,8 @@
const SkScalar xpos[], SkScalar constY,
const SkPaint&) SK_OVERRIDE;
+ virtual void drawRect(const SkRect& rect, const SkPaint&) SK_OVERRIDE;
+
virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) SK_OVERRIDE;
virtual void drawSprite(const SkBitmap&, int left, int top,
@@ -238,11 +242,6 @@
static const int kVizImageHeight = 256;
static const int kVizImageWidth = 256;
-protected:
- virtual void onDrawRect(const SkRect& rect, const SkPaint&) SK_OVERRIDE;
-
- virtual void onDrawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
-
private:
SkTDArray<SkDrawCommand*> fCommandVector;
int fHeight;
diff --git a/tests/TileGridTest.cpp b/tests/TileGridTest.cpp
index 3466871..8f5b18a 100644
--- a/tests/TileGridTest.cpp
+++ b/tests/TileGridTest.cpp
@@ -25,14 +25,13 @@
MockCanvas(SkBaseDevice* device) : SkCanvas(device)
{}
- SkTDArray<SkRect> fRects;
-
-protected:
- virtual void onDrawRect(const SkRect& rect, const SkPaint&)
+ virtual void drawRect(const SkRect& rect, const SkPaint&)
{
// This capture occurs before quick reject.
fRects.push(rect);
}
+
+ SkTDArray<SkRect> fRects;
};
class TileGridTest {