cc: Stop using TextureUploader for UIResources, HUD, and tests.
This adds a new simpler method to ResourceProvider called
CopyToResource and uses that instead. This removes TextureUploader
from the path of most impl-side painting code.
R=enne
BUG=454575
Review URL: https://codereview.chromium.org/938893002
Cr-Commit-Position: refs/heads/master@{#316978}
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 70dc582..ebd8990 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -3384,11 +3384,9 @@
format = ETC1;
break;
}
- id =
- resource_provider_->CreateResource(bitmap.GetSize(),
- wrap_mode,
- ResourceProvider::TextureHintImmutable,
- format);
+ id = resource_provider_->CreateResource(
+ bitmap.GetSize(), wrap_mode, ResourceProvider::TextureHintImmutable,
+ format);
UIResourceData data;
data.resource_id = id;
@@ -3398,11 +3396,8 @@
ui_resource_map_[uid] = data;
AutoLockUIResourceBitmap bitmap_lock(bitmap);
- resource_provider_->SetPixels(id,
- bitmap_lock.GetPixels(),
- gfx::Rect(bitmap.GetSize()),
- gfx::Rect(bitmap.GetSize()),
- gfx::Vector2d(0, 0));
+ resource_provider_->CopyToResource(id, bitmap_lock.GetPixels(),
+ bitmap.GetSize());
MarkUIResourceNotEvicted(uid);
}