OLD | NEW |
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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 // Resources that the GPU process has finished swapping. The key is the | 283 // Resources that the GPU process has finished swapping. The key is the |
284 // texture id of the resource. | 284 // texture id of the resource. |
285 std::map<unsigned, OverlayResourceLock> swapped_and_acked_overlay_resources_; | 285 std::map<unsigned, OverlayResourceLock> swapped_and_acked_overlay_resources_; |
286 | 286 |
287 unsigned offscreen_framebuffer_id_; | 287 unsigned offscreen_framebuffer_id_; |
288 | 288 |
289 std::unique_ptr<StaticGeometryBinding> shared_geometry_; | 289 std::unique_ptr<StaticGeometryBinding> shared_geometry_; |
290 std::unique_ptr<DynamicGeometryBinding> clipped_geometry_; | 290 std::unique_ptr<DynamicGeometryBinding> clipped_geometry_; |
291 gfx::QuadF shared_geometry_quad_; | 291 gfx::QuadF shared_geometry_quad_; |
292 | 292 |
293 // This block of bindings defines all of the programs used by the compositor | |
294 // itself. Add any new programs here to GLRendererShaderTest. | |
295 | |
296 // Tiled layer shaders. | |
297 typedef Program TileProgram; | |
298 typedef Program TileProgramAA; | |
299 typedef Program TileProgramSwizzleAA; | |
300 typedef Program TileProgramOpaque; | |
301 typedef Program TileProgramSwizzle; | |
302 typedef Program TileProgramSwizzleOpaque; | |
303 | |
304 // Texture shaders. | |
305 typedef Program TextureProgram; | |
306 typedef Program NonPremultipliedTextureProgram; | |
307 typedef Program TextureBackgroundProgram; | |
308 typedef Program NonPremultipliedTextureBackgroundProgram; | |
309 | |
310 // Render surface shaders. | |
311 typedef Program RenderPassProgram; | |
312 typedef Program RenderPassMaskProgram; | |
313 typedef Program RenderPassProgramAA; | |
314 typedef Program RenderPassMaskProgramAA; | |
315 typedef Program RenderPassColorMatrixProgram; | |
316 typedef Program RenderPassMaskColorMatrixProgramAA; | |
317 typedef Program RenderPassColorMatrixProgramAA; | |
318 typedef Program RenderPassMaskColorMatrixProgram; | |
319 | |
320 // Video shaders. | |
321 typedef Program VideoStreamTextureProgram; | |
322 typedef ProgramBinding<VertexShaderBase, FragmentShaderYUVVideo> | |
323 VideoYUVProgram; | |
324 | |
325 // Special purpose / effects shaders. | |
326 typedef Program DebugBorderProgram; | |
327 typedef Program SolidColorProgram; | |
328 typedef Program SolidColorProgramAA; | |
329 | |
330 // If the requested program has not yet been initialized, this will initialize | 293 // If the requested program has not yet been initialized, this will initialize |
331 // the program before returning it. | 294 // the program before returning it. |
332 const Program* GetProgram(const ProgramKey& key); | 295 const Program* GetProgram(const ProgramKey& key); |
333 | 296 |
334 // This will return nullptr if the requested program has not yet been | 297 // This will return nullptr if the requested program has not yet been |
335 // initialized. | 298 // initialized. |
336 const Program* GetProgramIfInitialized(const ProgramKey& key) const; | 299 const Program* GetProgramIfInitialized(const ProgramKey& key) const; |
337 | 300 |
338 std::unordered_map<ProgramKey, std::unique_ptr<Program>, ProgramKeyHash> | 301 std::unordered_map<ProgramKey, std::unique_ptr<Program>, ProgramKeyHash> |
339 program_cache_; | 302 program_cache_; |
340 | 303 |
341 const TileProgram* GetTileProgram( | 304 typedef ProgramBinding<VertexShaderBase, FragmentShaderYUVVideo> |
342 TexCoordPrecision precision, SamplerType sampler); | 305 VideoYUVProgram; |
343 const TileProgramOpaque* GetTileProgramOpaque( | |
344 TexCoordPrecision precision, SamplerType sampler); | |
345 const TileProgramAA* GetTileProgramAA( | |
346 TexCoordPrecision precision, SamplerType sampler); | |
347 const TileProgramSwizzle* GetTileProgramSwizzle( | |
348 TexCoordPrecision precision, SamplerType sampler); | |
349 const TileProgramSwizzleOpaque* GetTileProgramSwizzleOpaque( | |
350 TexCoordPrecision precision, SamplerType sampler); | |
351 const TileProgramSwizzleAA* GetTileProgramSwizzleAA( | |
352 TexCoordPrecision precision, SamplerType sampler); | |
353 | |
354 const RenderPassProgram* GetRenderPassProgram(TexCoordPrecision precision, | |
355 BlendMode blend_mode); | |
356 const RenderPassProgramAA* GetRenderPassProgramAA(TexCoordPrecision precision, | |
357 BlendMode blend_mode); | |
358 const RenderPassMaskProgram* GetRenderPassMaskProgram( | |
359 TexCoordPrecision precision, | |
360 SamplerType sampler, | |
361 BlendMode blend_mode, | |
362 bool mask_for_background); | |
363 const RenderPassMaskProgramAA* GetRenderPassMaskProgramAA( | |
364 TexCoordPrecision precision, | |
365 SamplerType sampler, | |
366 BlendMode blend_mode, | |
367 bool mask_for_background); | |
368 const RenderPassColorMatrixProgram* GetRenderPassColorMatrixProgram( | |
369 TexCoordPrecision precision, | |
370 BlendMode blend_mode); | |
371 const RenderPassColorMatrixProgramAA* GetRenderPassColorMatrixProgramAA( | |
372 TexCoordPrecision precision, | |
373 BlendMode blend_mode); | |
374 const RenderPassMaskColorMatrixProgram* GetRenderPassMaskColorMatrixProgram( | |
375 TexCoordPrecision precision, | |
376 SamplerType sampler, | |
377 BlendMode blend_mode, | |
378 bool mask_for_background); | |
379 const RenderPassMaskColorMatrixProgramAA* | |
380 GetRenderPassMaskColorMatrixProgramAA(TexCoordPrecision precision, | |
381 SamplerType sampler, | |
382 BlendMode blend_mode, | |
383 bool mask_for_background); | |
384 | |
385 const TextureProgram* GetTextureProgram(TexCoordPrecision precision, | |
386 SamplerType sampler); | |
387 const NonPremultipliedTextureProgram* GetNonPremultipliedTextureProgram( | |
388 TexCoordPrecision precision, | |
389 SamplerType sampler); | |
390 const TextureBackgroundProgram* GetTextureBackgroundProgram( | |
391 TexCoordPrecision precision, | |
392 SamplerType sampler); | |
393 const NonPremultipliedTextureBackgroundProgram* | |
394 GetNonPremultipliedTextureBackgroundProgram(TexCoordPrecision precision, | |
395 SamplerType sampler); | |
396 | |
397 const VideoYUVProgram* GetVideoYUVProgram(TexCoordPrecision precision, | 306 const VideoYUVProgram* GetVideoYUVProgram(TexCoordPrecision precision, |
398 SamplerType sampler, | 307 SamplerType sampler, |
399 bool use_alpha_texture, | 308 bool use_alpha_texture, |
400 bool use_nv12, | 309 bool use_nv12, |
401 bool use_color_lut); | 310 bool use_color_lut); |
402 const VideoStreamTextureProgram* GetVideoStreamTextureProgram( | |
403 TexCoordPrecision precision); | |
404 | |
405 const DebugBorderProgram* GetDebugBorderProgram(); | |
406 const SolidColorProgram* GetSolidColorProgram(); | |
407 const SolidColorProgramAA* GetSolidColorProgramAA(); | |
408 | |
409 VideoYUVProgram video_yuv_program_[LAST_TEX_COORD_PRECISION + 1] | 311 VideoYUVProgram video_yuv_program_[LAST_TEX_COORD_PRECISION + 1] |
410 [LAST_SAMPLER_TYPE + 1][2][2][2]; | 312 [LAST_SAMPLER_TYPE + 1][2][2][2]; |
411 | 313 |
412 gpu::gles2::GLES2Interface* gl_; | 314 gpu::gles2::GLES2Interface* gl_; |
413 gpu::ContextSupport* context_support_; | 315 gpu::ContextSupport* context_support_; |
414 std::unique_ptr<ContextCacheController::ScopedVisibility> context_visibility_; | 316 std::unique_ptr<ContextCacheController::ScopedVisibility> context_visibility_; |
415 | 317 |
416 TextureMailboxDeleter* texture_mailbox_deleter_; | 318 TextureMailboxDeleter* texture_mailbox_deleter_; |
417 | 319 |
418 gfx::Rect swap_buffer_rect_; | 320 gfx::Rect swap_buffer_rect_; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 bool force_drawing_frame_framebuffer_unflipped_ = false; | 361 bool force_drawing_frame_framebuffer_unflipped_ = false; |
460 | 362 |
461 BoundGeometry bound_geometry_; | 363 BoundGeometry bound_geometry_; |
462 ColorLUTCache color_lut_cache_; | 364 ColorLUTCache color_lut_cache_; |
463 DISALLOW_COPY_AND_ASSIGN(GLRenderer); | 365 DISALLOW_COPY_AND_ASSIGN(GLRenderer); |
464 }; | 366 }; |
465 | 367 |
466 } // namespace cc | 368 } // namespace cc |
467 | 369 |
468 #endif // CC_OUTPUT_GL_RENDERER_H_ | 370 #endif // CC_OUTPUT_GL_RENDERER_H_ |
OLD | NEW |