| Index: ui/compositor/clip_transform_recorder.cc
|
| diff --git a/ui/compositor/clip_transform_recorder.cc b/ui/compositor/clip_transform_recorder.cc
|
| index 5a773f27f6388f9bff0895d94e8ad3afd72b9bc0..653c818a162aca83c78c7f85bc46c7b9a24dde02 100644
|
| --- a/ui/compositor/clip_transform_recorder.cc
|
| +++ b/ui/compositor/clip_transform_recorder.cc
|
| @@ -7,35 +7,37 @@
|
| #include "ui/compositor/paint_context.h"
|
| #include "ui/gfx/canvas.h"
|
| #include "ui/gfx/geometry/rect.h"
|
| +#include "ui/gfx/path.h"
|
| #include "ui/gfx/transform.h"
|
|
|
| namespace ui {
|
|
|
| -ClipTransformRecorder::ClipTransformRecorder(const PaintContext& context,
|
| - const gfx::Rect& clip_rect)
|
| +ClipTransformRecorder::ClipTransformRecorder(const PaintContext& context)
|
| : canvas_(context.canvas()) {
|
| canvas_->Save();
|
| - canvas_->ClipRect(clip_rect);
|
| }
|
|
|
| -ClipTransformRecorder::ClipTransformRecorder(const PaintContext& context,
|
| - const gfx::Transform& transform)
|
| - : canvas_(context.canvas()) {
|
| - canvas_->Save();
|
| - canvas_->Transform(transform);
|
| +ClipTransformRecorder::~ClipTransformRecorder() {
|
| + canvas_->Restore();
|
| }
|
|
|
| -ClipTransformRecorder::ClipTransformRecorder(const PaintContext& context,
|
| - const gfx::Rect& clip_rect,
|
| - const gfx::Transform& transform)
|
| - : canvas_(context.canvas()) {
|
| - canvas_->Save();
|
| +void ClipTransformRecorder::ClipRect(const gfx::Rect& clip_rect) {
|
| canvas_->ClipRect(clip_rect);
|
| - canvas_->Transform(transform);
|
| }
|
|
|
| -ClipTransformRecorder::~ClipTransformRecorder() {
|
| - canvas_->Restore();
|
| +void ClipTransformRecorder::ClipPath(const gfx::Path& clip_path) {
|
| + bool anti_alias = false;
|
| + canvas_->ClipPath(clip_path, anti_alias);
|
| +}
|
| +
|
| +void ClipTransformRecorder::ClipPathWithAntiAliasing(
|
| + const gfx::Path& clip_path) {
|
| + bool anti_alias = true;
|
| + canvas_->ClipPath(clip_path, anti_alias);
|
| +}
|
| +
|
| +void ClipTransformRecorder::Transform(const gfx::Transform& transform) {
|
| + canvas_->Transform(transform);
|
| }
|
|
|
| } // namespace ui
|
|
|