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

Unified Diff: ui/views/view.cc

Issue 1055473003: views: Remove early out for empty clip. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: viewclipearlyout: comments Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 9497dc5ed61b9b4ca24f15ee696b904a73595d16..d17c98722c3cb9b8b0f65d969779f4719fbeac43 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -778,22 +778,18 @@ void View::Paint(const PaintContext& parent_context) {
// If the view is backed by a layer, it should paint with itself as the origin
// rather than relative to its parent.
if (!layer()) {
- // Set the clip rect to the bounds of this View and translating the origin
- // to the local bounds' top left point.
- //
- // Note that the X (or left) position we pass to ClipRectInt takes into
- // consideration whether or not the view uses a right-to-left layout so that
- // we paint our view in its mirrored position if need be.
+ // 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
+ // mirrored position if need be.
gfx::Rect clip_rect = bounds();
clip_rect.Inset(clip_insets_);
if (parent_)
clip_rect.set_x(parent_->GetMirroredXForRect(clip_rect));
canvas->ClipRect(clip_rect);
- if (canvas->IsClipEmpty())
- return;
- // Non-empty clip, translate the graphics such that 0,0 corresponds to where
- // this view is located (related to its parent).
+ // Translate the graphics such that 0,0 corresponds to where
+ // this View is located relative to its parent.
canvas->Translate(GetMirroredPosition().OffsetFromOrigin());
canvas->Transform(GetTransform());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698