Chromium Code Reviews| Index: cc/trees/layer_tree_host.cc |
| diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc |
| index 27659e054bea869e8bcc1940036e2f5d82fead9b..3d193f7560ce5bc8e242cb3555871bc6c2b1a321 100644 |
| --- a/cc/trees/layer_tree_host.cc |
| +++ b/cc/trees/layer_tree_host.cc |
| @@ -142,6 +142,9 @@ bool LayerTreeHost::InitializeProxy(scoped_ptr<Proxy> proxy) { |
| LayerTreeHost::~LayerTreeHost() { |
| TRACE_EVENT0("cc", "LayerTreeHost::~LayerTreeHost"); |
| + |
| + overhang_ui_resource_.reset(); |
|
enne (OOO)
2013/09/03 23:18:26
Why does this need to be explicit?
ccameron
2013/09/04 02:36:47
The documentation of ScopedUIResource says that a
|
| + |
| if (root_layer_.get()) |
| root_layer_->SetLayerTreeHost(NULL); |
| @@ -369,6 +372,11 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) { |
| if (!settings_.impl_side_painting) |
| sync_tree->ProcessUIResourceRequestQueue(); |
| } |
| + if (overhang_ui_resource_) { |
| + host_impl->SetOverhangUIResource( |
| + overhang_ui_resource_->id(), |
| + overhang_ui_resource_->GetSize()); |
| + } |
| DCHECK(!sync_tree->ViewportSizeInvalid()); |
| @@ -623,6 +631,21 @@ void LayerTreeHost::SetPageScaleFactorAndLimits(float page_scale_factor, |
| SetNeedsCommit(); |
| } |
| +void LayerTreeHost::SetOverhangBitmap(const SkBitmap& bitmap) { |
| + DCHECK(bitmap.width() && bitmap.height()); |
| + DCHECK_EQ(bitmap.bytesPerPixel(), 4); |
| + |
| + scoped_refptr<UIResourceBitmap> overhang_ui_bitmap(UIResourceBitmap::Create( |
| + new uint8_t[bitmap.width() * bitmap.height() * bitmap.bytesPerPixel()], |
| + UIResourceBitmap::RGBA8, |
| + gfx::Size(bitmap.width(), bitmap.height()))); |
| + bitmap.copyPixelsTo( |
| + overhang_ui_bitmap->GetPixels(), |
| + bitmap.width() * bitmap.height() * bitmap.bytesPerPixel(), |
| + bitmap.width() * bitmap.bytesPerPixel()); |
| + overhang_ui_resource_ = ScopedUIResource::Create(this, overhang_ui_bitmap); |
| +} |
| + |
| void LayerTreeHost::SetVisible(bool visible) { |
| if (visible_ == visible) |
| return; |