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

Side by Side Diff: ui/gfx/compositor/layer.cc

Issue 9703068: Clip constrained windows to the tabcontents bounds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/compositor/layer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/compositor/layer.h" 5 #include "ui/gfx/compositor/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 GetAnimator()->SetBounds(bounds); 164 GetAnimator()->SetBounds(bounds);
165 } 165 }
166 166
167 gfx::Rect Layer::GetTargetBounds() const { 167 gfx::Rect Layer::GetTargetBounds() const {
168 if (animator_.get() && animator_->IsAnimatingProperty( 168 if (animator_.get() && animator_->IsAnimatingProperty(
169 LayerAnimationElement::BOUNDS)) 169 LayerAnimationElement::BOUNDS))
170 return animator_->GetTargetBounds(); 170 return animator_->GetTargetBounds();
171 return bounds_; 171 return bounds_;
172 } 172 }
173 173
174 void Layer::SetMasksToBounds(bool masks_to_bounds) {
175 web_layer_.setMasksToBounds(masks_to_bounds);
176 }
177
178 bool Layer::GetMasksToBounds() const {
179 return web_layer_.masksToBounds();
180 }
181
174 void Layer::SetOpacity(float opacity) { 182 void Layer::SetOpacity(float opacity) {
175 GetAnimator()->SetOpacity(opacity); 183 GetAnimator()->SetOpacity(opacity);
176 } 184 }
177 185
178 float Layer::GetTargetOpacity() const { 186 float Layer::GetTargetOpacity() const {
179 if (animator_.get() && animator_->IsAnimatingProperty( 187 if (animator_.get() && animator_->IsAnimatingProperty(
180 LayerAnimationElement::OPACITY)) 188 LayerAnimationElement::OPACITY))
181 return animator_->GetTargetOpacity(); 189 return animator_->GetTargetOpacity();
182 return opacity_; 190 return opacity_;
183 } 191 }
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 return; 534 return;
527 unsigned int color = 0xFF000000; 535 unsigned int color = 0xFF000000;
528 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000; 536 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000;
529 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f); 537 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f);
530 if (!opaque) 538 if (!opaque)
531 color |= 0xFF; 539 color |= 0xFF;
532 web_layer_.setDebugBorderColor(color); 540 web_layer_.setDebugBorderColor(color);
533 } 541 }
534 542
535 } // namespace ui 543 } // namespace ui
OLDNEW
« no previous file with comments | « ui/gfx/compositor/layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698