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

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

Issue 2575533002: SkClipOp is an enum class now (Closed)
Patch Set: Created 4 years 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 | « ui/gfx/canvas.h ('k') | ui/gfx/image/image_skia_operations.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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 189
190 void Canvas::ClipRect(const Rect& rect, SkClipOp op) { 190 void Canvas::ClipRect(const Rect& rect, SkClipOp op) {
191 canvas_->clipRect(RectToSkRect(rect), op); 191 canvas_->clipRect(RectToSkRect(rect), op);
192 } 192 }
193 193
194 void Canvas::ClipRect(const RectF& rect, SkClipOp op) { 194 void Canvas::ClipRect(const RectF& rect, SkClipOp op) {
195 canvas_->clipRect(RectFToSkRect(rect), op); 195 canvas_->clipRect(RectFToSkRect(rect), op);
196 } 196 }
197 197
198 void Canvas::ClipPath(const SkPath& path, bool do_anti_alias) { 198 void Canvas::ClipPath(const SkPath& path, bool do_anti_alias) {
199 canvas_->clipPath(path, kIntersect_SkClipOp, do_anti_alias); 199 canvas_->clipPath(path, SkClipOp::kIntersect, do_anti_alias);
200 } 200 }
201 201
202 bool Canvas::IsClipEmpty() const { 202 bool Canvas::IsClipEmpty() const {
203 return canvas_->isClipEmpty(); 203 return canvas_->isClipEmpty();
204 } 204 }
205 205
206 bool Canvas::GetClipBounds(Rect* bounds) { 206 bool Canvas::GetClipBounds(Rect* bounds) {
207 SkRect out; 207 SkRect out;
208 if (canvas_->getClipBounds(&out)) { 208 if (canvas_->getClipBounds(&out)) {
209 *bounds = ToEnclosingRect(SkRectToRectF(out)); 209 *bounds = ToEnclosingRect(SkRectToRectF(out));
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 p.setFilterQuality(filter ? kLow_SkFilterQuality : kNone_SkFilterQuality); 588 p.setFilterQuality(filter ? kLow_SkFilterQuality : kNone_SkFilterQuality);
589 p.setShader(CreateImageRepShaderForScale( 589 p.setShader(CreateImageRepShaderForScale(
590 image_rep, SkShader::kRepeat_TileMode, shader_scale, 590 image_rep, SkShader::kRepeat_TileMode, shader_scale,
591 remove_image_scale ? image_rep.scale() : 1.f)); 591 remove_image_scale ? image_rep.scale() : 1.f));
592 592
593 // The rect will be filled by the bitmap. 593 // The rect will be filled by the bitmap.
594 canvas_->drawRect(dest_rect, p); 594 canvas_->drawRect(dest_rect, p);
595 } 595 }
596 596
597 } // namespace gfx 597 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/canvas.h ('k') | ui/gfx/image/image_skia_operations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698