diff options
author | reed <reed@google.com> | 2014-11-11 19:36:09 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-11 19:36:10 -0800 |
commit | 6a070dc06af4e9f305f9d08a69e34d18ade473cb (patch) | |
tree | 48723d46a9e7ba7246445e98b960add2c7eabce3 /src | |
parent | ad8aa1dcf36d64ddf849b914281713b901a01f49 (diff) |
experimental
BUG=skia:
Review URL: https://codereview.chromium.org/716793004
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkCanvas.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 2d9b55929b..ead844fcc1 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -6,6 +6,7 @@ */ #include "SkCanvas.h" +#include "SkCanvasDrawable.h" #include "SkCanvasPriv.h" #include "SkBitmapDevice.h" #include "SkDeviceImageFilterProxy.h" @@ -2304,6 +2305,19 @@ void SkCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], LOOPER_END } +void SkCanvas::EXPERIMENTAL_drawDrawable(SkCanvasDrawable* dr) { + if (dr) { + SkRect bounds; + if (!dr->getBounds(&bounds) || !this->quickReject(bounds)) { + this->onDrawDrawable(dr); + } + } +} + +void SkCanvas::onDrawDrawable(SkCanvasDrawable* dr) { + dr->draw(this); +} + ////////////////////////////////////////////////////////////////////////////// // These methods are NOT virtual, and therefore must call back into virtual // methods, rather than actually drawing themselves. |