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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 41903003: cc: Fix incomplete changes to add ETC1 support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed compilation issues Created 7 years, 1 month 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/scheduler/texture_uploader.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 a16e9c17c33ac3b81b21f1dcbe36aa1524c8a8af..5d3887858bf4bec789796a4fc38d6d338f4e3ca7 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2734,7 +2734,6 @@ void LayerTreeHostImpl::SetDebugState(
void LayerTreeHostImpl::CreateUIResource(UIResourceId uid,
const UIResourceBitmap& bitmap) {
DCHECK_GT(uid, 0);
- DCHECK_EQ(bitmap.GetFormat(), UIResourceBitmap::RGBA8);
GLint wrap_mode = 0;
switch (bitmap.GetWrapMode()) {
@@ -2751,11 +2750,15 @@ void LayerTreeHostImpl::CreateUIResource(UIResourceId uid,
ResourceProvider::ResourceId id = ResourceIdForUIResource(uid);
if (id)
DeleteUIResource(uid);
+
+ ResourceFormat format = resource_provider_->best_texture_format();
+ if (bitmap.GetFormat() == UIResourceBitmap::ETC1)
+ format = ETC1;
id = resource_provider_->CreateResource(
bitmap.GetSize(),
wrap_mode,
ResourceProvider::TextureUsageAny,
- resource_provider_->best_texture_format());
+ format);
UIResourceData data;
data.resource_id = id;
« no previous file with comments | « cc/scheduler/texture_uploader.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