summaryrefslogtreecommitdiffstats
path: root/ui/views/view.cc
diff options
context:
space:
mode:
authorrobertphillips@google.com <robertphillips@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-03 15:41:16 +0000
committerrobertphillips@google.com <robertphillips@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-03 15:41:16 +0000
commita91031711e0aaba9b35376640c9eedc05002a17a (patch)
tree6d9e4a816b0d5e02b57381ef31eb5411c99a3bf5 /ui/views/view.cc
parent2d8fd7ab51ce459d91971fe0ee15aca84deeadb5 (diff)
downloadchromium_src-a91031711e0aaba9b35376640c9eedc05002a17a.zip
chromium_src-a91031711e0aaba9b35376640c9eedc05002a17a.tar.gz
chromium_src-a91031711e0aaba9b35376640c9eedc05002a17a.tar.bz2
Skia is disassociating information about the state of the clip from the clip calls because this information isn't free for all backends. In particular, keeping track of the clip state for each clip call can get quite expensive for the GPU backend for small scenes. This CL updates the Canvas API to match where Skia will be moving to.
At a higher level, how much does the short circuiting based on the clip state pay off for these call sites. If the benefit is marginal it may be worth removing the calls to IsClipEmpty. asvitkine@ for ui/gfx sky@ for ui/aura and ui/views Review URL: https://codereview.chromium.org/179983003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254466 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/view.cc')
-rw-r--r--ui/views/view.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 2025a0d..0ce6c97 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -791,7 +791,8 @@ void View::Paint(gfx::Canvas* canvas) {
clip_rect.Inset(clip_insets_);
if (parent_)
clip_rect.set_x(parent_->GetMirroredXForRect(clip_rect));
- if (!canvas->ClipRect(clip_rect))
+ canvas->ClipRect(clip_rect);
+ if (canvas->IsClipEmpty())
return;
// Non-empty clip, translate the graphics such that 0,0 corresponds to