OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |