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

Unified Diff: cc/resources/resource_pool.cc

Issue 1379783002: Allow one-copy task tile worker pool to use compressed textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/resources/resource_pool.cc
diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc
index 835c37d6c32d9f23029bcfea419ad6f8f2b3f2fc..a94d46e8878578842d0ef6f6c2116d4ae5e2f8e0 100644
--- a/cc/resources/resource_pool.cc
+++ b/cc/resources/resource_pool.cc
@@ -89,8 +89,16 @@ ResourcePool::~ResourcePool() {
DCHECK_EQ(0u, total_resource_count_);
}
-Resource* ResourcePool::AcquireResource(const gfx::Size& size,
+Resource* ResourcePool::AcquireResource(const gfx::Size& desired_size,
reveman 2015/09/30 09:55:15 Can we instead just make sure resource dimensions
christiank 2015/11/26 15:35:35 I guess that makes sense. I am not sure if there a
reveman 2015/11/27 16:46:49 https://code.google.com/p/chromium/codesearch#chro
christiank 2015/11/30 15:41:08 Perfect, thanks! Will look at this tomorrow.
christiank 2015/12/01 15:01:07 Should now be fixed.
ResourceFormat format) {
+ gfx::Size size = desired_size;
+ if (IsResourceFormatCompressed(format) &&
+ (size.width() % 4 != 0 || size.height() % 4 != 0)) {
+ // Round the size up to the nearest multiple of four.
+ size.SetSize(4 * std::ceil(static_cast<float>(size.width()) / 4),
+ 4 * std::ceil(static_cast<float>(size.height()) / 4));
+ }
+
for (ResourceDeque::iterator it = unused_resources_.begin();
it != unused_resources_.end(); ++it) {
ScopedResource* resource = *it;

Powered by Google App Engine
This is Rietveld 408576698