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

Unified Diff: cc/output/gl_renderer.h

Issue 2613903002: The great shader refactor: Move all programs to a common cache (Closed)
Patch Set: Created 3 years, 11 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/output/gl_renderer.cc » ('j') | cc/output/gl_renderer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.h
diff --git a/cc/output/gl_renderer.h b/cc/output/gl_renderer.h
index d5cc12924f7749e30118b02b17deba6dfc173b88..51288858a75f2e3229381ad5d7e652f182dd4ece 100644
--- a/cc/output/gl_renderer.h
+++ b/cc/output/gl_renderer.h
@@ -327,6 +327,10 @@ class CC_EXPORT GLRenderer : public DirectRenderer {
typedef ProgramBinding<FragmentShaderBase> SolidColorProgram;
typedef ProgramBinding<FragmentShaderBase> SolidColorProgramAA;
+ typedef ProgramBinding<FragmentShaderBase> Program;
+ const Program* GetProgram(const ProgramKey& desc);
+ const Program* GetProgramForTesting(const ProgramKey& desc) const;
+
const TileProgram* GetTileProgram(
TexCoordPrecision precision, SamplerType sampler);
const TileProgramOpaque* GetTileProgramOpaque(
@@ -395,71 +399,9 @@ class CC_EXPORT GLRenderer : public DirectRenderer {
const SolidColorProgram* GetSolidColorProgram();
const SolidColorProgramAA* GetSolidColorProgramAA();
ccameron 2017/01/05 10:32:27 Avoiding adding another dimension to all of these
enne (OOO) 2017/01/09 19:46:48 Thank you for continuing to clean up this mess. I
- TileProgram
- tile_program_[LAST_TEX_COORD_PRECISION + 1][LAST_SAMPLER_TYPE + 1];
- TileProgramOpaque
- tile_program_opaque_[LAST_TEX_COORD_PRECISION + 1][LAST_SAMPLER_TYPE + 1];
- TileProgramAA
- tile_program_aa_[LAST_TEX_COORD_PRECISION + 1][LAST_SAMPLER_TYPE + 1];
- TileProgramSwizzle tile_program_swizzle_[LAST_TEX_COORD_PRECISION +
- 1][LAST_SAMPLER_TYPE + 1];
- TileProgramSwizzleOpaque
- tile_program_swizzle_opaque_[LAST_TEX_COORD_PRECISION +
- 1][LAST_SAMPLER_TYPE + 1];
- TileProgramSwizzleAA tile_program_swizzle_aa_[LAST_TEX_COORD_PRECISION +
- 1][LAST_SAMPLER_TYPE + 1];
-
- TextureProgram
- texture_program_[LAST_TEX_COORD_PRECISION + 1][LAST_SAMPLER_TYPE + 1];
- NonPremultipliedTextureProgram
- nonpremultiplied_texture_program_[LAST_TEX_COORD_PRECISION +
- 1][LAST_SAMPLER_TYPE + 1];
- TextureBackgroundProgram
- texture_background_program_[LAST_TEX_COORD_PRECISION +
- 1][LAST_SAMPLER_TYPE + 1];
- NonPremultipliedTextureBackgroundProgram
- nonpremultiplied_texture_background_program_[LAST_TEX_COORD_PRECISION +
- 1][LAST_SAMPLER_TYPE + 1];
-
- RenderPassProgram
- render_pass_program_[LAST_TEX_COORD_PRECISION + 1][LAST_BLEND_MODE + 1];
- RenderPassProgramAA render_pass_program_aa_[LAST_TEX_COORD_PRECISION +
- 1][LAST_BLEND_MODE + 1];
- RenderPassMaskProgram
- render_pass_mask_program_[LAST_TEX_COORD_PRECISION + 1]
- [LAST_SAMPLER_TYPE + 1]
- [LAST_BLEND_MODE + 1]
- [LAST_MASK_VALUE + 1];
- RenderPassMaskProgramAA
- render_pass_mask_program_aa_[LAST_TEX_COORD_PRECISION + 1]
- [LAST_SAMPLER_TYPE + 1]
- [LAST_BLEND_MODE + 1]
- [LAST_MASK_VALUE + 1];
- RenderPassColorMatrixProgram
- render_pass_color_matrix_program_[LAST_TEX_COORD_PRECISION +
- 1][LAST_BLEND_MODE + 1];
- RenderPassColorMatrixProgramAA
- render_pass_color_matrix_program_aa_[LAST_TEX_COORD_PRECISION +
- 1][LAST_BLEND_MODE + 1];
- RenderPassMaskColorMatrixProgram
- render_pass_mask_color_matrix_program_[LAST_TEX_COORD_PRECISION + 1]
- [LAST_SAMPLER_TYPE + 1]
- [LAST_BLEND_MODE + 1]
- [LAST_MASK_VALUE + 1];
- RenderPassMaskColorMatrixProgramAA
- render_pass_mask_color_matrix_program_aa_[LAST_TEX_COORD_PRECISION + 1]
- [LAST_SAMPLER_TYPE + 1]
- [LAST_BLEND_MODE + 1]
- [LAST_MASK_VALUE + 1];
-
+ std::unordered_map<ProgramKey, Program*, ProgramKeyHash> program_cache_;
enne (OOO) 2017/01/09 19:46:48 Can you make the Program* a unique_ptr<Program>?
ccameron 2017/01/11 09:46:39 Yes, good point!
VideoYUVProgram video_yuv_program_[LAST_TEX_COORD_PRECISION + 1]
[LAST_SAMPLER_TYPE + 1][2][2][2];
- VideoStreamTextureProgram
- video_stream_texture_program_[LAST_TEX_COORD_PRECISION + 1];
-
- DebugBorderProgram debug_border_program_;
- SolidColorProgram solid_color_program_;
- SolidColorProgramAA solid_color_program_aa_;
gpu::gles2::GLES2Interface* gl_;
gpu::ContextSupport* context_support_;
« no previous file with comments | « no previous file | cc/output/gl_renderer.cc » ('j') | cc/output/gl_renderer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698