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

Unified Diff: cc/resources/prioritized_resource.cc

Issue 21159007: cc: Adding support for RGBA_4444 tile textures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed a signed vs. unsigned comparison in video_resource_updater.cc 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/resources/prioritized_resource.h ('k') | cc/resources/prioritized_resource_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/prioritized_resource.cc
diff --git a/cc/resources/prioritized_resource.cc b/cc/resources/prioritized_resource.cc
index 78fd90055a9a6e05077a7b752a4ca8c8f35f4404..313b275a3abd7658955b20373063a51b7ab0305d 100644
--- a/cc/resources/prioritized_resource.cc
+++ b/cc/resources/prioritized_resource.cc
@@ -15,7 +15,7 @@ namespace cc {
PrioritizedResource::PrioritizedResource(PrioritizedResourceManager* manager,
gfx::Size size,
- GLenum format)
+ ResourceFormat format)
: size_(size),
format_(format),
bytes_(0),
@@ -25,10 +25,7 @@ PrioritizedResource::PrioritizedResource(PrioritizedResourceManager* manager,
is_self_managed_(false),
backing_(NULL),
manager_(NULL) {
- // manager_ is set in RegisterTexture() so validity can be checked.
- DCHECK(format || size.IsEmpty());
- if (format)
- bytes_ = Resource::MemorySizeBytes(size, format);
+ bytes_ = Resource::MemorySizeBytes(size, format);
if (manager)
manager->RegisterTexture(this);
}
@@ -48,7 +45,7 @@ void PrioritizedResource::SetTextureManager(
manager->RegisterTexture(this);
}
-void PrioritizedResource::SetDimensions(gfx::Size size, GLenum format) {
+void PrioritizedResource::SetDimensions(gfx::Size size, ResourceFormat format) {
if (format_ != format || size_ != size) {
is_above_priority_cutoff_ = false;
format_ = format;
@@ -113,7 +110,7 @@ void PrioritizedResource::Unlink() {
}
void PrioritizedResource::SetToSelfManagedMemoryPlaceholder(size_t bytes) {
- SetDimensions(gfx::Size(), GL_RGBA);
+ SetDimensions(gfx::Size(), RGBA_8888);
set_is_self_managed(true);
bytes_ = bytes;
}
@@ -121,7 +118,7 @@ void PrioritizedResource::SetToSelfManagedMemoryPlaceholder(size_t bytes) {
PrioritizedResource::Backing::Backing(unsigned id,
ResourceProvider* resource_provider,
gfx::Size size,
- GLenum format)
+ ResourceFormat format)
: Resource(id, size, format),
owner_(NULL),
priority_at_last_priority_update_(PriorityCalculator::LowestPriority()),
« no previous file with comments | « cc/resources/prioritized_resource.h ('k') | cc/resources/prioritized_resource_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698