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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 22870016: Update the nine patch layer to use UI resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ccameron's fix for exisiting nine-patch uses 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
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 82a67eed79d4df6453f73323ba3b6905f36f0d54..50b2f46fa5e0153e3b95a0bac08bd9522c17fcdd 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2617,14 +2617,13 @@ void LayerTreeHostImpl::SetDebugState(
SetFullRootLayerDamage();
}
-void LayerTreeHostImpl::CreateUIResource(
- UIResourceId uid,
- scoped_refptr<UIResourceBitmap> bitmap) {
+void LayerTreeHostImpl::CreateUIResource(UIResourceId uid,
+ const UIResourceBitmap& bitmap) {
DCHECK_GT(uid, 0);
- DCHECK_EQ(bitmap->GetFormat(), UIResourceBitmap::RGBA8);
+ DCHECK_EQ(bitmap.GetFormat(), UIResourceBitmap::RGBA8);
GLint wrap_mode = 0;
- switch (bitmap->GetWrapMode()) {
+ switch (bitmap.GetWrapMode()) {
case UIResourceBitmap::CLAMP_TO_EDGE:
wrap_mode = GL_CLAMP_TO_EDGE;
break;
@@ -2639,16 +2638,16 @@ void LayerTreeHostImpl::CreateUIResource(
if (id)
DeleteUIResource(uid);
id = resource_provider_->CreateResource(
- bitmap->GetSize(),
+ bitmap.GetSize(),
resource_provider_->best_texture_format(),
wrap_mode,
ResourceProvider::TextureUsageAny);
ui_resource_map_[uid] = id;
resource_provider_->SetPixels(id,
- reinterpret_cast<uint8_t*>(bitmap->GetPixels()),
- gfx::Rect(bitmap->GetSize()),
- gfx::Rect(bitmap->GetSize()),
+ bitmap.GetPixels(),
+ gfx::Rect(bitmap.GetSize()),
+ gfx::Rect(bitmap.GetSize()),
gfx::Vector2d(0, 0));
MarkUIResourceNotEvicted(uid);
}

Powered by Google App Engine
This is Rietveld 408576698