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

Unified Diff: ui/views/view.cc

Issue 1062813004: views: Use ClipTransformRecorder to access canvas in ProfileChooserView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 7b4e8d52b6e882c7fc8a24dd933c1fdad2135933..7a0fcb3fb2068d4c9c18f1c27ed8fdb07df6e0a1 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -780,6 +780,8 @@ void View::Paint(const ui::PaintContext& parent_context) {
// rather than relative to its parent.
scoped_ptr<ui::ClipTransformRecorder> clip_transform_recorder;
if (!layer()) {
+ clip_transform_recorder.reset(new ui::ClipTransformRecorder(context));
+
// Set the clip rect to the bounds of this View. Note that the X (or left)
// position we pass to ClipRect takes into consideration whether or not the
// View uses a right-to-left layout so that we paint the View in its
@@ -789,6 +791,7 @@ void View::Paint(const ui::PaintContext& parent_context) {
if (parent_)
clip_rect_in_parent.set_x(
parent_->GetMirroredXForRect(clip_rect_in_parent));
+ clip_transform_recorder->ClipRect(clip_rect_in_parent);
// Translate the graphics such that 0,0 corresponds to where
// this View is located relative to its parent.
@@ -797,9 +800,7 @@ void View::Paint(const ui::PaintContext& parent_context) {
transform_from_parent.Translate(offset_from_parent.x(),
offset_from_parent.y());
transform_from_parent.PreconcatTransform(GetTransform());
-
- clip_transform_recorder = make_scoped_ptr(new ui::ClipTransformRecorder(
- context, clip_rect_in_parent, transform_from_parent));
+ clip_transform_recorder->Transform(transform_from_parent);
}
{
« ui/compositor/clip_transform_recorder.h ('K') | « ui/compositor/clip_transform_recorder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698