Commit 7adee63b authored by ben@chromium.org's avatar ben@chromium.org

Clip constrained windows to the tabcontents bounds.

There may be a way to add this at a lower level (i.e. in ui/aura) but that seems somewhat risky. I haven't come up with the good generic rule yet.

http://crbug.com/108753
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9703068

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126964 0039d316-1c4b-4281-b951-d872f2087c98
parent 8c803bdb
......@@ -21,6 +21,7 @@
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/dragdrop/os_exchange_data_provider_aura.h"
#include "ui/gfx/compositor/layer.h"
#include "ui/views/views_delegate.h"
#include "ui/views/widget/widget.h"
#include "webkit/glue/webdropdata.h"
......@@ -163,6 +164,7 @@ void NativeTabContentsViewAura::InitNativeTabContentsView() {
params.parent = NULL;
params.can_activate = true;
GetWidget()->Init(params);
GetNativeView()->layer()->SetMasksToBounds(true);
GetNativeWindow()->SetName("NativeTabContentsViewAura");
#if defined(USE_ASH)
ash::SetChildWindowVisibilityChangesAnimated(GetWidget()->GetNativeView());
......
......@@ -171,6 +171,14 @@ gfx::Rect Layer::GetTargetBounds() const {
return bounds_;
}
void Layer::SetMasksToBounds(bool masks_to_bounds) {
web_layer_.setMasksToBounds(masks_to_bounds);
}
bool Layer::GetMasksToBounds() const {
return web_layer_.masksToBounds();
}
void Layer::SetOpacity(float opacity) {
GetAnimator()->SetOpacity(opacity);
}
......
......@@ -128,6 +128,11 @@ class COMPOSITOR_EXPORT Layer :
// otherwise.
gfx::Rect GetTargetBounds() const;
// Sets/gets whether or not drawing of child layers should be clipped to the
// bounds of this layer.
void SetMasksToBounds(bool masks_to_bounds);
bool GetMasksToBounds() const;
// The opacity of the layer. The opacity is applied to each pixel of the
// texture (resulting alpha = opacity * alpha).
float opacity() const { return opacity_; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment