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

Unified Diff: cc/resources/resource_pool.cc

Issue 2235623003: cc: Add gfx::ColorSpace to cc::ResourceProvider resource creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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/resources/resource_pool.h ('k') | cc/resources/resource_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_pool.cc
diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc
index fe4dabc88be54531abc023fdeb781786fa0ef126..669897a0a3ba5e74c896c45cf766dd6b3566ffeb 100644
--- a/cc/resources/resource_pool.cc
+++ b/cc/resources/resource_pool.cc
@@ -95,7 +95,8 @@ ResourcePool::~ResourcePool() {
}
Resource* ResourcePool::AcquireResource(const gfx::Size& size,
- ResourceFormat format) {
+ ResourceFormat format,
+ const gfx::ColorSpace& color_space) {
// Finding resources in |unused_resources_| from MRU to LRU direction, touches
// LRU resources only if needed, which increases possibility of expiring more
// LRU resources within kResourceExpirationDelayMs.
@@ -108,6 +109,8 @@ Resource* ResourcePool::AcquireResource(const gfx::Size& size,
continue;
if (resource->size() != size)
continue;
+ if (resource->color_space() != color_space)
+ continue;
// Transfer resource to |in_use_resources_|.
in_use_resources_[resource->id()] = std::move(*it);
@@ -121,10 +124,11 @@ Resource* ResourcePool::AcquireResource(const gfx::Size& size,
PoolResource::Create(resource_provider_);
if (use_gpu_memory_buffers_) {
- pool_resource->AllocateWithGpuMemoryBuffer(size, format, usage_);
+ pool_resource->AllocateWithGpuMemoryBuffer(size, format, usage_,
+ color_space);
} else {
pool_resource->Allocate(size, ResourceProvider::TEXTURE_HINT_IMMUTABLE,
- format);
+ format, color_space);
}
DCHECK(ResourceUtil::VerifySizeInBytes<size_t>(pool_resource->size(),
« no previous file with comments | « cc/resources/resource_pool.h ('k') | cc/resources/resource_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698