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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 23805002: [cc] Enable specifying a overhang/gutter texture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback Created 7 years, 3 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 | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
+
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;
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698