# 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
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,
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;}
}
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;
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);
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
// 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
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;
};
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;
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,
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
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,
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;
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,
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;
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,
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;
}
}
-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);
}
}
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;
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
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()) {
}
-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()) {
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);
}
}
-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);
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,
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);
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,
* 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,
}
}
-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))) {
}
}
-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))) {
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();
}
}
-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();
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());
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());
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");
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");
}
}
-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);
}
}
-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);
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);
}
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);
}
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));
}
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));
}
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[],
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,
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;
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 {