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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/output/gl_renderer.cc » ('j') | cc/output/gl_renderer.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_OUTPUT_GL_RENDERER_H_ 5 #ifndef CC_OUTPUT_GL_RENDERER_H_
6 #define CC_OUTPUT_GL_RENDERER_H_ 6 #define CC_OUTPUT_GL_RENDERER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 320
321 // Video shaders. 321 // Video shaders.
322 typedef ProgramBinding<FragmentShaderBase> VideoStreamTextureProgram; 322 typedef ProgramBinding<FragmentShaderBase> VideoStreamTextureProgram;
323 typedef ProgramBinding<FragmentShaderYUVVideo> VideoYUVProgram; 323 typedef ProgramBinding<FragmentShaderYUVVideo> VideoYUVProgram;
324 324
325 // Special purpose / effects shaders. 325 // Special purpose / effects shaders.
326 typedef ProgramBinding<FragmentShaderBase> DebugBorderProgram; 326 typedef ProgramBinding<FragmentShaderBase> DebugBorderProgram;
327 typedef ProgramBinding<FragmentShaderBase> SolidColorProgram; 327 typedef ProgramBinding<FragmentShaderBase> SolidColorProgram;
328 typedef ProgramBinding<FragmentShaderBase> SolidColorProgramAA; 328 typedef ProgramBinding<FragmentShaderBase> SolidColorProgramAA;
329 329
330 typedef ProgramBinding<FragmentShaderBase> Program;
331 const Program* GetProgram(const ProgramKey& desc);
332 const Program* GetProgramForTesting(const ProgramKey& desc) const;
333
330 const TileProgram* GetTileProgram( 334 const TileProgram* GetTileProgram(
331 TexCoordPrecision precision, SamplerType sampler); 335 TexCoordPrecision precision, SamplerType sampler);
332 const TileProgramOpaque* GetTileProgramOpaque( 336 const TileProgramOpaque* GetTileProgramOpaque(
333 TexCoordPrecision precision, SamplerType sampler); 337 TexCoordPrecision precision, SamplerType sampler);
334 const TileProgramAA* GetTileProgramAA( 338 const TileProgramAA* GetTileProgramAA(
335 TexCoordPrecision precision, SamplerType sampler); 339 TexCoordPrecision precision, SamplerType sampler);
336 const TileProgramSwizzle* GetTileProgramSwizzle( 340 const TileProgramSwizzle* GetTileProgramSwizzle(
337 TexCoordPrecision precision, SamplerType sampler); 341 TexCoordPrecision precision, SamplerType sampler);
338 const TileProgramSwizzleOpaque* GetTileProgramSwizzleOpaque( 342 const TileProgramSwizzleOpaque* GetTileProgramSwizzleOpaque(
339 TexCoordPrecision precision, SamplerType sampler); 343 TexCoordPrecision precision, SamplerType sampler);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 SamplerType sampler, 391 SamplerType sampler,
388 bool use_alpha_texture, 392 bool use_alpha_texture,
389 bool use_nv12, 393 bool use_nv12,
390 bool use_color_lut); 394 bool use_color_lut);
391 const VideoStreamTextureProgram* GetVideoStreamTextureProgram( 395 const VideoStreamTextureProgram* GetVideoStreamTextureProgram(
392 TexCoordPrecision precision); 396 TexCoordPrecision precision);
393 397
394 const DebugBorderProgram* GetDebugBorderProgram(); 398 const DebugBorderProgram* GetDebugBorderProgram();
395 const SolidColorProgram* GetSolidColorProgram(); 399 const SolidColorProgram* GetSolidColorProgram();
396 const SolidColorProgramAA* GetSolidColorProgramAA(); 400 const SolidColorProgramAA* GetSolidColorProgramAA();
397 401
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
398 TileProgram 402 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!
399 tile_program_[LAST_TEX_COORD_PRECISION + 1][LAST_SAMPLER_TYPE + 1];
400 TileProgramOpaque
401 tile_program_opaque_[LAST_TEX_COORD_PRECISION + 1][LAST_SAMPLER_TYPE + 1];
402 TileProgramAA
403 tile_program_aa_[LAST_TEX_COORD_PRECISION + 1][LAST_SAMPLER_TYPE + 1];
404 TileProgramSwizzle tile_program_swizzle_[LAST_TEX_COORD_PRECISION +
405 1][LAST_SAMPLER_TYPE + 1];
406 TileProgramSwizzleOpaque
407 tile_program_swizzle_opaque_[LAST_TEX_COORD_PRECISION +
408 1][LAST_SAMPLER_TYPE + 1];
409 TileProgramSwizzleAA tile_program_swizzle_aa_[LAST_TEX_COORD_PRECISION +
410 1][LAST_SAMPLER_TYPE + 1];
411
412 TextureProgram
413 texture_program_[LAST_TEX_COORD_PRECISION + 1][LAST_SAMPLER_TYPE + 1];
414 NonPremultipliedTextureProgram
415 nonpremultiplied_texture_program_[LAST_TEX_COORD_PRECISION +
416 1][LAST_SAMPLER_TYPE + 1];
417 TextureBackgroundProgram
418 texture_background_program_[LAST_TEX_COORD_PRECISION +
419 1][LAST_SAMPLER_TYPE + 1];
420 NonPremultipliedTextureBackgroundProgram
421 nonpremultiplied_texture_background_program_[LAST_TEX_COORD_PRECISION +
422 1][LAST_SAMPLER_TYPE + 1];
423
424 RenderPassProgram
425 render_pass_program_[LAST_TEX_COORD_PRECISION + 1][LAST_BLEND_MODE + 1];
426 RenderPassProgramAA render_pass_program_aa_[LAST_TEX_COORD_PRECISION +
427 1][LAST_BLEND_MODE + 1];
428 RenderPassMaskProgram
429 render_pass_mask_program_[LAST_TEX_COORD_PRECISION + 1]
430 [LAST_SAMPLER_TYPE + 1]
431 [LAST_BLEND_MODE + 1]
432 [LAST_MASK_VALUE + 1];
433 RenderPassMaskProgramAA
434 render_pass_mask_program_aa_[LAST_TEX_COORD_PRECISION + 1]
435 [LAST_SAMPLER_TYPE + 1]
436 [LAST_BLEND_MODE + 1]
437 [LAST_MASK_VALUE + 1];
438 RenderPassColorMatrixProgram
439 render_pass_color_matrix_program_[LAST_TEX_COORD_PRECISION +
440 1][LAST_BLEND_MODE + 1];
441 RenderPassColorMatrixProgramAA
442 render_pass_color_matrix_program_aa_[LAST_TEX_COORD_PRECISION +
443 1][LAST_BLEND_MODE + 1];
444 RenderPassMaskColorMatrixProgram
445 render_pass_mask_color_matrix_program_[LAST_TEX_COORD_PRECISION + 1]
446 [LAST_SAMPLER_TYPE + 1]
447 [LAST_BLEND_MODE + 1]
448 [LAST_MASK_VALUE + 1];
449 RenderPassMaskColorMatrixProgramAA
450 render_pass_mask_color_matrix_program_aa_[LAST_TEX_COORD_PRECISION + 1]
451 [LAST_SAMPLER_TYPE + 1]
452 [LAST_BLEND_MODE + 1]
453 [LAST_MASK_VALUE + 1];
454
455 VideoYUVProgram video_yuv_program_[LAST_TEX_COORD_PRECISION + 1] 403 VideoYUVProgram video_yuv_program_[LAST_TEX_COORD_PRECISION + 1]
456 [LAST_SAMPLER_TYPE + 1][2][2][2]; 404 [LAST_SAMPLER_TYPE + 1][2][2][2];
457 VideoStreamTextureProgram
458 video_stream_texture_program_[LAST_TEX_COORD_PRECISION + 1];
459
460 DebugBorderProgram debug_border_program_;
461 SolidColorProgram solid_color_program_;
462 SolidColorProgramAA solid_color_program_aa_;
463 405
464 gpu::gles2::GLES2Interface* gl_; 406 gpu::gles2::GLES2Interface* gl_;
465 gpu::ContextSupport* context_support_; 407 gpu::ContextSupport* context_support_;
466 std::unique_ptr<ContextCacheController::ScopedVisibility> context_visibility_; 408 std::unique_ptr<ContextCacheController::ScopedVisibility> context_visibility_;
467 409
468 TextureMailboxDeleter* texture_mailbox_deleter_; 410 TextureMailboxDeleter* texture_mailbox_deleter_;
469 411
470 gfx::Rect swap_buffer_rect_; 412 gfx::Rect swap_buffer_rect_;
471 gfx::Rect scissor_rect_; 413 gfx::Rect scissor_rect_;
472 bool is_using_bind_uniform_; 414 bool is_using_bind_uniform_;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 bool force_drawing_frame_framebuffer_unflipped_ = false; 453 bool force_drawing_frame_framebuffer_unflipped_ = false;
512 454
513 BoundGeometry bound_geometry_; 455 BoundGeometry bound_geometry_;
514 ColorLUTCache color_lut_cache_; 456 ColorLUTCache color_lut_cache_;
515 DISALLOW_COPY_AND_ASSIGN(GLRenderer); 457 DISALLOW_COPY_AND_ASSIGN(GLRenderer);
516 }; 458 };
517 459
518 } // namespace cc 460 } // namespace cc
519 461
520 #endif // CC_OUTPUT_GL_RENDERER_H_ 462 #endif // CC_OUTPUT_GL_RENDERER_H_
OLDNEW
« 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