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

Unified Diff: skia/ext/analysis_canvas.cc

Issue 492943002: AnalysisCanvas is missing an override for virtual void onClipRegion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 | « skia/ext/analysis_canvas.h ('k') | skia/ext/analysis_canvas_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/analysis_canvas.cc
diff --git a/skia/ext/analysis_canvas.cc b/skia/ext/analysis_canvas.cc
index cb6160759fbaba0ac7b6b82b9b5c239cc4604089..8be5f5b1f33d558c207f6ccf5ab77ea54d0cdb7f 100644
--- a/skia/ext/analysis_canvas.cc
+++ b/skia/ext/analysis_canvas.cc
@@ -331,15 +331,8 @@ bool AnalysisCanvas::abortDrawing() {
return false;
}
-void AnalysisCanvas::onClipRect(const SkRect& rect, SkRegion::Op op,
- ClipEdgeStyle edge_style) {
-
- INHERITED::onClipRect(rect, op, edge_style);
-}
-
-void AnalysisCanvas::onClipPath(const SkPath& path, SkRegion::Op op,
- ClipEdgeStyle edge_style) {
- // clipPaths can make our calls to IsFullQuad invalid (ie have false
+void AnalysisCanvas::OnComplexClip() {
+ // complex clips can make our calls to IsFullQuad invalid (ie have false
// positives). As a precaution, force the setting to be non-solid
// and non-transparent until we pop this
if (force_not_solid_stack_level_ == kNoLayer) {
@@ -350,28 +343,39 @@ void AnalysisCanvas::onClipPath(const SkPath& path, SkRegion::Op op,
force_not_transparent_stack_level_ = saved_stack_size_;
SetForceNotTransparent(true);
}
+}
+void AnalysisCanvas::onClipRect(const SkRect& rect,
+ SkRegion::Op op,
+ ClipEdgeStyle edge_style) {
+ INHERITED::onClipRect(rect, op, edge_style);
+}
+
+void AnalysisCanvas::onClipPath(const SkPath& path,
+ SkRegion::Op op,
+ ClipEdgeStyle edge_style) {
+ OnComplexClip();
INHERITED::onClipRect(path.getBounds(), op, edge_style);
}
void AnalysisCanvas::onClipRRect(const SkRRect& rrect,
SkRegion::Op op,
ClipEdgeStyle edge_style) {
- // clipRRect can make our calls to IsFullQuad invalid (ie have false
- // positives). As a precaution, force the setting to be non-solid
- // and non-transparent until we pop this
- if (force_not_solid_stack_level_ == kNoLayer) {
- force_not_solid_stack_level_ = saved_stack_size_;
- SetForceNotSolid(true);
- }
- if (force_not_transparent_stack_level_ == kNoLayer) {
- force_not_transparent_stack_level_ = saved_stack_size_;
- SetForceNotTransparent(true);
- }
-
+ OnComplexClip();
INHERITED::onClipRect(rrect.getBounds(), op, edge_style);
}
+void AnalysisCanvas::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
+ const ClipEdgeStyle edge_style = kHard_ClipEdgeStyle;
+ if (deviceRgn.isRect()) {
+ onClipRect(SkRect::MakeFromIRect(deviceRgn.getBounds()), op, edge_style);
+ return;
+ }
+ OnComplexClip();
+ INHERITED::onClipRect(
+ SkRect::MakeFromIRect(deviceRgn.getBounds()), op, edge_style);
+}
+
void AnalysisCanvas::willSave() {
++saved_stack_size_;
INHERITED::willSave();
« no previous file with comments | « skia/ext/analysis_canvas.h ('k') | skia/ext/analysis_canvas_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698