Commit 935ff6ca authored by reveman@chromium.org's avatar reveman@chromium.org

gpu: Optimize and cleanup shader code used for CHROMIUM_copy_texture.

Removes all dependent texture lookups and makes sure we're not using
unnecessarily high precision for texture coordinates.

BUG=269808

Review URL: https://codereview.chromium.org/257803011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266801 0039d316-1c4b-4281-b951-d872f2087c98
parent 8f73bc9e
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_
#define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_
#include <vector>
#include "base/containers/hash_tables.h" #include "base/containers/hash_tables.h"
#include "gpu/command_buffer/service/gl_utils.h" #include "gpu/command_buffer/service/gl_utils.h"
#include "gpu/gpu_export.h" #include "gpu/gpu_export.h"
...@@ -48,20 +50,22 @@ class GPU_EXPORT CopyTextureCHROMIUMResourceManager { ...@@ -48,20 +50,22 @@ class GPU_EXPORT CopyTextureCHROMIUMResourceManager {
private: private:
struct ProgramInfo { struct ProgramInfo {
ProgramInfo() : program(0u), matrix_handle(0u), sampler_locations(0u) {} ProgramInfo() : program(0u), matrix_handle(0u), sampler_handle(0u) {}
GLuint program; GLuint program;
GLuint matrix_handle; GLuint matrix_handle;
GLuint sampler_locations; GLuint sampler_handle;
}; };
bool initialized_; bool initialized_;
typedef std::vector<GLuint> ShaderVector;
ShaderVector vertex_shaders_;
ShaderVector fragment_shaders_;
typedef std::pair<int, int> ProgramMapKey; typedef std::pair<int, int> ProgramMapKey;
typedef base::hash_map<ProgramMapKey, ProgramInfo> ProgramMap; typedef base::hash_map<ProgramMapKey, ProgramInfo> ProgramMap;
ProgramMap programs_; ProgramMap programs_;
GLuint buffer_id_; GLuint buffer_id_;
GLuint framebuffer_; GLuint framebuffer_;
GLuint vertex_shader_;
DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager); DISALLOW_COPY_AND_ASSIGN(CopyTextureCHROMIUMResourceManager);
}; };
...@@ -69,5 +73,3 @@ class GPU_EXPORT CopyTextureCHROMIUMResourceManager { ...@@ -69,5 +73,3 @@ class GPU_EXPORT CopyTextureCHROMIUMResourceManager {
} // namespace gpu. } // namespace gpu.
#endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_ #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_COPY_TEXTURE_CHROMIUM_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment