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, |