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

Unified Diff: skia/ext/pixel_ref_utils.cc

Issue 199043004: Make PixelRefUtils::GatherDiscardablePixelRefs use Skia's version of the NoSaveLayerCanvas (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed Created 6 years, 9 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 | « no previous file | skia/skia_library.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/pixel_ref_utils.cc
diff --git a/skia/ext/pixel_ref_utils.cc b/skia/ext/pixel_ref_utils.cc
index 26aef37ab64c4ebf218c9e715cd3c066d51e728f..e380e97ea3a01dac6fb8e169b0a0b84eb87077e6 100644
--- a/skia/ext/pixel_ref_utils.cc
+++ b/skia/ext/pixel_ref_utils.cc
@@ -14,6 +14,7 @@
#include "third_party/skia/include/core/SkRRect.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/skia/include/core/SkShader.h"
+#include "third_party/skia/include/utils/SkNoSaveLayerCanvas.h"
#include "third_party/skia/src/core/SkRasterClip.h"
namespace skia {
@@ -349,42 +350,6 @@ class GatherPixelRefDevice : public SkBitmapDevice {
}
};
-class NoSaveLayerCanvas : public SkCanvas {
- public:
- NoSaveLayerCanvas(SkBaseDevice* device) : INHERITED(device) {}
-
- protected:
- // Turn saveLayer() into save() for speed, should not affect correctness.
- virtual SaveLayerStrategy willSaveLayer(const SkRect* bounds,
- const SkPaint* paint,
- SaveFlags flags) SK_OVERRIDE {
- this->INHERITED::willSaveLayer(bounds, paint, flags);
- return kNoLayer_SaveLayerStrategy;
- }
-
- // Disable aa for speed.
- virtual void onClipRect(const SkRect& rect,
- SkRegion::Op op,
- ClipEdgeStyle edge_style) SK_OVERRIDE {
- this->INHERITED::onClipRect(rect, op, kHard_ClipEdgeStyle);
- }
-
- virtual void onClipPath(const SkPath& path,
- SkRegion::Op op,
- ClipEdgeStyle edge_style) SK_OVERRIDE {
- this->updateClipConservativelyUsingBounds(path.getBounds(), op,
- path.isInverseFillType());
- }
- virtual void onClipRRect(const SkRRect& rrect,
- SkRegion::Op op,
- ClipEdgeStyle edge_style) SK_OVERRIDE {
- this->updateClipConservativelyUsingBounds(rrect.getBounds(), op, false);
- }
-
- private:
- typedef SkCanvas INHERITED;
-};
-
} // namespace
void PixelRefUtils::GatherDiscardablePixelRefs(
@@ -398,7 +363,7 @@ void PixelRefUtils::GatherDiscardablePixelRefs(
SkBitmap::kNo_Config, picture->width(), picture->height());
GatherPixelRefDevice device(empty_bitmap, &pixel_ref_set);
- NoSaveLayerCanvas canvas(&device);
+ SkNoSaveLayerCanvas canvas(&device);
canvas.clipRect(SkRect::MakeWH(picture->width(), picture->height()),
SkRegion::kIntersect_Op,
« no previous file with comments | « no previous file | skia/skia_library.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698