diff options
author | Herb Derby <herb@google.com> | 2018-03-15 17:34:40 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-16 20:28:36 +0000 |
commit | 76d69b44bbba118a6769b5fb267588ccac41a815 (patch) | |
tree | 2fdb871fb4f7ae9b00721661cd3fa361ba4cbfbd /include | |
parent | 7278d68cac9e39970144909df449113d43fff480 (diff) |
Apply filterTextFlags so the fonts are the same.
In order to apply filterTextFlags correctly, teach
TrackLayerDevice how to process save and restore layers.
At this point, I don't see any other traffic than the
cache warming traffic.
This code has a performance between 82% and 105% of just
drawing the picture.
BUG=skia:7515
Change-Id: I44736be46884f18b6d120d4b5ca582f34dbdff0f
Reviewed-on: https://skia-review.googlesource.com/114641
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkCanvas.h | 4 | ||||
-rw-r--r-- | include/utils/SkNoDrawCanvas.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index a426d1e546..e90408dc33 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -2445,6 +2445,7 @@ public: void private_draw_shadow_rec(const SkPath&, const SkDrawShadowRec&); + protected: // default impl defers to getDevice()->newSurface(info) virtual sk_sp<SkSurface> onNewSurface(const SkImageInfo& info, const SkSurfaceProps& props); @@ -2559,6 +2560,8 @@ protected: bool clipRectBounds(const SkRect* bounds, SaveLayerFlags flags, SkIRect* intersection, const SkImageFilter* imageFilter = nullptr); + SkBaseDevice* getTopDevice() const; + private: /** After calling saveLayer(), there can be any number of devices that make up the top-most drawing area. LayerIter can be used to iterate through @@ -2620,7 +2623,6 @@ private: } SkBaseDevice* getDevice() const; - SkBaseDevice* getTopDevice() const; class MCRec; diff --git a/include/utils/SkNoDrawCanvas.h b/include/utils/SkNoDrawCanvas.h index 7475956704..4c67226946 100644 --- a/include/utils/SkNoDrawCanvas.h +++ b/include/utils/SkNoDrawCanvas.h @@ -29,6 +29,8 @@ public: // TODO: investigate the users of this ctor. SkNoDrawCanvas(const SkIRect&); + explicit SkNoDrawCanvas(SkBaseDevice* device); + // Optimization to reset state to be the same as after construction. void resetCanvas(int width, int height) { resetForNextPicture(SkIRect::MakeWH(width, height)); |