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

Side by Side Diff: ui/gfx/canvas.cc

Issue 771563003: use SkClipOps where we can, legacyClip where we need to rework Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « skia/ext/vector_canvas_unittest.cc ('k') | ui/ozone/platform/dri/dri_window_delegate_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/canvas.h" 5 #include "ui/gfx/canvas.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 196
197 void Canvas::Restore() { 197 void Canvas::Restore() {
198 canvas_->restore(); 198 canvas_->restore();
199 } 199 }
200 200
201 void Canvas::ClipRect(const Rect& rect) { 201 void Canvas::ClipRect(const Rect& rect) {
202 canvas_->clipRect(RectToSkRect(rect)); 202 canvas_->clipRect(RectToSkRect(rect));
203 } 203 }
204 204
205 void Canvas::ClipPath(const SkPath& path, bool do_anti_alias) { 205 void Canvas::ClipPath(const SkPath& path, bool do_anti_alias) {
206 canvas_->clipPath(path, SkRegion::kIntersect_Op, do_anti_alias); 206 canvas_->clipPath(path, kIntersect_SkClipOp, do_anti_alias);
207 } 207 }
208 208
209 bool Canvas::IsClipEmpty() const { 209 bool Canvas::IsClipEmpty() const {
210 return canvas_->isClipEmpty(); 210 return canvas_->isClipEmpty();
211 } 211 }
212 212
213 bool Canvas::GetClipBounds(Rect* bounds) { 213 bool Canvas::GetClipBounds(Rect* bounds) {
214 SkRect out; 214 SkRect out;
215 if (canvas_->getClipBounds(&out)) { 215 if (canvas_->getClipBounds(&out)) {
216 *bounds = ToEnclosingRect(SkRectToRectF(out)); 216 *bounds = ToEnclosingRect(SkRectToRectF(out));
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 SkPaint p(paint); 634 SkPaint p(paint);
635 p.setFilterLevel(filter ? SkPaint::kLow_FilterLevel 635 p.setFilterLevel(filter ? SkPaint::kLow_FilterLevel
636 : SkPaint::kNone_FilterLevel); 636 : SkPaint::kNone_FilterLevel);
637 p.setShader(shader.get()); 637 p.setShader(shader.get());
638 638
639 // The rect will be filled by the bitmap. 639 // The rect will be filled by the bitmap.
640 canvas_->drawRect(dest_rect, p); 640 canvas_->drawRect(dest_rect, p);
641 } 641 }
642 642
643 } // namespace gfx 643 } // namespace gfx
OLDNEW
« no previous file with comments | « skia/ext/vector_canvas_unittest.cc ('k') | ui/ozone/platform/dri/dri_window_delegate_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698