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

Unified Diff: gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h

Issue 255763002: gpu: Refactor and cleanup CHROMIUM_copy_texture implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: format Created 6 years, 8 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: gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h
diff --git a/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h b/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h
index 097eb2ce46e80df41c34955b116a90618647c6a9..a34fd7c143395e913635358a16c6fdf73133cba4 100644
--- a/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h
+++ b/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h
@@ -5,6 +5,8 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_
#define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_
+#include <map>
+
#include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/gpu_export.h"
@@ -21,6 +23,7 @@ class GLES2Decoder;
class GPU_EXPORT CopyTextureCHROMIUMResourceManager {
public:
CopyTextureCHROMIUMResourceManager();
+ ~CopyTextureCHROMIUMResourceManager();
void Initialize(const gles2::GLES2Decoder* decoder);
void Destroy();
@@ -45,14 +48,21 @@ class GPU_EXPORT CopyTextureCHROMIUMResourceManager {
static const GLuint kVertexPositionAttrib = 0;
private:
- bool initialized_;
+ struct ProgramInfo {
+ ProgramInfo() : program(0u), matrix_handle(0u), sampler_locations(0u) {}
- static const int kNumPrograms = 12;
- GLuint programs_[kNumPrograms];
+ GLuint program;
+ GLuint matrix_handle;
+ GLuint sampler_locations;
+ };
+
+ bool initialized_;
+ typedef std::pair<int, int> ProgramMapKey;
+ typedef std::map<ProgramMapKey, ProgramInfo> ProgramMap;
piman 2014/04/25 03:30:40 nit: hash_map, or even SmallMap.
reveman 2014/04/25 20:27:10 Done.
+ ProgramMap programs_;
GLuint buffer_id_;
GLuint framebuffer_;
- GLuint matrix_handle_[kNumPrograms];
- GLuint sampler_locations_[kNumPrograms];
+ GLuint vertex_shader_;
DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager);
};

Powered by Google App Engine
This is Rietveld 408576698