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

Unified Diff: cc/resources/resource_provider.cc

Issue 1269503007: Unify graphics buffer format & usage enums for GpuMemoryBuffer & SurfaceFactoryOzone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add header to BUILD.gn Created 5 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 | « no previous file | cc/test/test_gpu_memory_buffer_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_provider.cc
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
index 9f680669c089de2a3781732f5f4fca54987caf44..24c293f132e449f899f9fad0b848908aa0d5824e 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -113,14 +113,14 @@ GrPixelConfig ToGrPixelConfig(ResourceFormat format) {
return kSkia8888_GrPixelConfig;
}
-gfx::GpuMemoryBuffer::Format ToGpuMemoryBufferFormat(ResourceFormat format) {
+gfx::BufferFormat ToGpuMemoryBufferFormat(ResourceFormat format) {
switch (format) {
case RGBA_8888:
- return gfx::GpuMemoryBuffer::RGBA_8888;
+ return gfx::BufferFormat::RGBA_8888;
case BGRA_8888:
- return gfx::GpuMemoryBuffer::BGRA_8888;
+ return gfx::BufferFormat::BGRA_8888;
case RGBA_4444:
- return gfx::GpuMemoryBuffer::RGBA_4444;
+ return gfx::BufferFormat::RGBA_4444;
case ALPHA_8:
case LUMINANCE_8:
case RGB_565:
@@ -129,7 +129,7 @@ gfx::GpuMemoryBuffer::Format ToGpuMemoryBufferFormat(ResourceFormat format) {
break;
}
NOTREACHED();
- return gfx::GpuMemoryBuffer::RGBA_8888;
+ return gfx::BufferFormat::RGBA_8888;
}
class ScopedSetActiveTexture {
@@ -989,10 +989,10 @@ gfx::GpuMemoryBuffer*
ResourceProvider::ScopedWriteLockGpuMemoryBuffer::GetGpuMemoryBuffer() {
if (gpu_memory_buffer_)
return gpu_memory_buffer_;
- gfx::GpuMemoryBuffer::Usage usage =
+ gfx::BufferUsage usage =
resource_provider_->use_persistent_map_for_gpu_memory_buffers()
- ? gfx::GpuMemoryBuffer::PERSISTENT_MAP
- : gfx::GpuMemoryBuffer::MAP;
+ ? gfx::BufferUsage::PERSISTENT_MAP
+ : gfx::BufferUsage::MAP;
scoped_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer =
gpu_memory_buffer_manager_->AllocateGpuMemoryBuffer(
size_, ToGpuMemoryBufferFormat(format_), usage);
« no previous file with comments | « no previous file | cc/test/test_gpu_memory_buffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698