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

Unified Diff: blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.cc

Issue 2207453002: Properly set the BufferToTextureTargetMap in Blimp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unused code. 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 | « blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.cc
diff --git a/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.cc b/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.cc
index f1c05796992c98d7a163479de7d8bbf1540331da..437269ad5fec17b7835a92618eb653dbfcc1f032 100644
--- a/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.cc
+++ b/blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.cc
@@ -4,6 +4,7 @@
#include "blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.h"
+#include <GLES2/gl2.h>
#include <stddef.h>
#include <stdint.h>
@@ -101,6 +102,24 @@ BlimpGpuMemoryBufferManager::BlimpGpuMemoryBufferManager() {}
BlimpGpuMemoryBufferManager::~BlimpGpuMemoryBufferManager() {}
+// static
+cc::BufferToTextureTargetMap
+BlimpGpuMemoryBufferManager::GetDefaultBufferToTextureTargetMap() {
+ cc::BufferToTextureTargetMap image_targets;
+ for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST);
+ ++usage_idx) {
+ gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx);
+ for (int format_idx = 0;
+ format_idx <= static_cast<int>(gfx::BufferFormat::LAST);
+ ++format_idx) {
+ gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx);
+ image_targets.insert(cc::BufferToTextureTargetMap::value_type(
+ cc::BufferToTextureTargetKey(usage, format), GL_TEXTURE_2D));
+ }
+ }
+ return image_targets;
+}
+
std::unique_ptr<gfx::GpuMemoryBuffer>
BlimpGpuMemoryBufferManager::AllocateGpuMemoryBuffer(
const gfx::Size& size,
« no previous file with comments | « blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698