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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 22529002: [cc] Allow resources and ui resources to specify wrap mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix botched resolve 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.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d9cc1fecf1c59d7b164c5bd4dcafc10a939aae28..d94e20d131257a91b99fed3befa615760b4a2ac8 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2602,6 +2602,16 @@ void LayerTreeHostImpl::CreateUIResource(
DCHECK_GT(uid, 0);
DCHECK_EQ(bitmap->GetFormat(), UIResourceBitmap::RGBA8);
+ GLint wrap_mode = 0;
+ switch (bitmap->GetWrapMode()) {
+ case UIResourceBitmap::CLAMP_TO_EDGE:
+ wrap_mode = GL_CLAMP_TO_EDGE;
+ break;
+ case UIResourceBitmap::REPEAT:
+ wrap_mode = GL_REPEAT;
+ break;
+ }
+
// Allow for multiple creation requests with the same UIResourceId. The
// previous resource is simply deleted.
ResourceProvider::ResourceId id = ResourceIdForUIResource(uid);
@@ -2610,6 +2620,7 @@ void LayerTreeHostImpl::CreateUIResource(
id = resource_provider_->CreateResource(
bitmap->GetSize(),
resource_provider_->best_texture_format(),
+ wrap_mode,
ResourceProvider::TextureUsageAny);
ui_resource_map_[uid] = id;
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698