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

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: deprecate GLenum format throughout 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
Index: cc/resources/prioritized_resource.cc
diff --git a/cc/resources/prioritized_resource.cc b/cc/resources/prioritized_resource.cc
index 78fd90055a9a6e05077a7b752a4ca8c8f35f4404..b60673b65eb4b036c05a4628972bc56ea7271519 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)
+ ResourceProvider::TextureFormat format)
: size_(size),
format_(format),
bytes_(0),
@@ -27,8 +27,9 @@ PrioritizedResource::PrioritizedResource(PrioritizedResourceManager* manager,
manager_(NULL) {
// manager_ is set in RegisterTexture() so validity can be checked.
DCHECK(format || size.IsEmpty());
- if (format)
+ if (format) {
bytes_ = Resource::MemorySizeBytes(size, format);
+ }
if (manager)
manager->RegisterTexture(this);
}
@@ -48,7 +49,8 @@ void PrioritizedResource::SetTextureManager(
manager->RegisterTexture(this);
}
-void PrioritizedResource::SetDimensions(gfx::Size size, GLenum format) {
+void PrioritizedResource::SetDimensions(
+ gfx::Size size, ResourceProvider::TextureFormat format) {
if (format_ != format || size_ != size) {
is_above_priority_cutoff_ = false;
format_ = format;
@@ -113,7 +115,7 @@ void PrioritizedResource::Unlink() {
}
void PrioritizedResource::SetToSelfManagedMemoryPlaceholder(size_t bytes) {
- SetDimensions(gfx::Size(), GL_RGBA);
+ SetDimensions(gfx::Size(), ResourceProvider::RGBA_8888);
set_is_self_managed(true);
bytes_ = bytes;
}
@@ -121,7 +123,7 @@ void PrioritizedResource::SetToSelfManagedMemoryPlaceholder(size_t bytes) {
PrioritizedResource::Backing::Backing(unsigned id,
ResourceProvider* resource_provider,
gfx::Size size,
- GLenum format)
+ ResourceProvider::TextureFormat format)
: Resource(id, size, format),
owner_(NULL),
priority_at_last_priority_update_(PriorityCalculator::LowestPriority()),

Powered by Google App Engine
This is Rietveld 408576698