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

Side by Side Diff: cc/output/gl_renderer.h

Issue 2677893003: cc: Add color conversion support to all DrawQuad types (Closed)
Patch Set: Update w/2681223002 Created 3 years, 10 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') | no next file with comments »
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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 void SetShaderQuadF(const gfx::QuadF& quad); 208 void SetShaderQuadF(const gfx::QuadF& quad);
209 void SetShaderMatrix(const gfx::Transform& transform); 209 void SetShaderMatrix(const gfx::Transform& transform);
210 void SetShaderColor(SkColor color, float opacity); 210 void SetShaderColor(SkColor color, float opacity);
211 void DrawQuadGeometryClippedByQuadF(const gfx::Transform& draw_transform, 211 void DrawQuadGeometryClippedByQuadF(const gfx::Transform& draw_transform,
212 const gfx::RectF& quad_rect, 212 const gfx::RectF& quad_rect,
213 const gfx::QuadF& clipping_region_quad, 213 const gfx::QuadF& clipping_region_quad,
214 const float uv[8]); 214 const float uv[8]);
215 void DrawQuadGeometry(const gfx::Transform& projection_matrix, 215 void DrawQuadGeometry(const gfx::Transform& projection_matrix,
216 const gfx::Transform& draw_transform, 216 const gfx::Transform& draw_transform,
217 const gfx::RectF& quad_rect); 217 const gfx::RectF& quad_rect);
218 void SetUseProgram(const Program* program); 218
219 // If |dst_color_space| is invalid, then no color conversion (apart from
220 // YUV to RGB conversion) is performed. This explicit argument is available
221 // so that video color conversion can be enabled separately from general color
222 // conversion.
223 // TODO(ccameron): Remove the version with an explicit |dst_color_space|,
224 // since that will always be the device color space.
225 void SetUseProgram(const ProgramKey& program_key,
226 const gfx::ColorSpace& src_color_space,
227 const gfx::ColorSpace& dst_color_space);
228 void SetUseProgram(const ProgramKey& program_key,
229 const gfx::ColorSpace& src_color_space);
219 230
220 bool MakeContextCurrent(); 231 bool MakeContextCurrent();
221 232
222 void InitializeSharedObjects(); 233 void InitializeSharedObjects();
223 void CleanupSharedObjects(); 234 void CleanupSharedObjects();
224 235
225 typedef base::Callback<void(std::unique_ptr<CopyOutputRequest> copy_request, 236 typedef base::Callback<void(std::unique_ptr<CopyOutputRequest> copy_request,
226 bool success)> 237 bool success)>
227 AsyncGetFramebufferPixelsCleanupCallback; 238 AsyncGetFramebufferPixelsCleanupCallback;
228 void FinishedReadback(unsigned source_buffer, 239 void FinishedReadback(unsigned source_buffer,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 // Resources that the GPU process has finished swapping. The key is the 284 // Resources that the GPU process has finished swapping. The key is the
274 // texture id of the resource. 285 // texture id of the resource.
275 std::map<unsigned, OverlayResourceLock> swapped_and_acked_overlay_resources_; 286 std::map<unsigned, OverlayResourceLock> swapped_and_acked_overlay_resources_;
276 287
277 unsigned offscreen_framebuffer_id_ = 0u; 288 unsigned offscreen_framebuffer_id_ = 0u;
278 289
279 std::unique_ptr<StaticGeometryBinding> shared_geometry_; 290 std::unique_ptr<StaticGeometryBinding> shared_geometry_;
280 std::unique_ptr<DynamicGeometryBinding> clipped_geometry_; 291 std::unique_ptr<DynamicGeometryBinding> clipped_geometry_;
281 gfx::QuadF shared_geometry_quad_; 292 gfx::QuadF shared_geometry_quad_;
282 293
283 // If the requested program has not yet been initialized, this will initialize
284 // the program before returning it.
285 const Program* GetProgram(const ProgramKey& key);
286
287 // This will return nullptr if the requested program has not yet been 294 // This will return nullptr if the requested program has not yet been
288 // initialized. 295 // initialized.
289 const Program* GetProgramIfInitialized(const ProgramKey& key) const; 296 const Program* GetProgramIfInitialized(const ProgramKey& key) const;
290 297
291 std::unordered_map<ProgramKey, std::unique_ptr<Program>, ProgramKeyHash> 298 std::unordered_map<ProgramKey, std::unique_ptr<Program>, ProgramKeyHash>
292 program_cache_; 299 program_cache_;
293 300
294 gpu::gles2::GLES2Interface* gl_; 301 gpu::gles2::GLES2Interface* gl_;
295 gpu::ContextSupport* context_support_; 302 gpu::ContextSupport* context_support_;
296 std::unique_ptr<ContextCacheController::ScopedVisibility> context_visibility_; 303 std::unique_ptr<ContextCacheController::ScopedVisibility> context_visibility_;
297 304
298 TextureMailboxDeleter* texture_mailbox_deleter_; 305 TextureMailboxDeleter* texture_mailbox_deleter_;
299 306
300 gfx::Rect swap_buffer_rect_; 307 gfx::Rect swap_buffer_rect_;
301 gfx::Rect scissor_rect_; 308 gfx::Rect scissor_rect_;
302 bool is_scissor_enabled_ = false; 309 bool is_scissor_enabled_ = false;
303 bool stencil_shadow_ = false; 310 bool stencil_shadow_ = false;
304 bool blend_shadow_ = false; 311 bool blend_shadow_ = false;
305 const Program* program_shadow_ = nullptr; 312 const Program* current_program_ = nullptr;
enne (OOO) 2017/02/10 22:40:42 I considered suggesting this rename earlier...so t
306 TexturedQuadDrawCache draw_cache_; 313 TexturedQuadDrawCache draw_cache_;
307 int highp_threshold_min_ = 0; 314 int highp_threshold_min_ = 0;
308 int highp_threshold_cache_ = 0; 315 int highp_threshold_cache_ = 0;
309 316
310 struct PendingAsyncReadPixels; 317 struct PendingAsyncReadPixels;
311 std::vector<std::unique_ptr<PendingAsyncReadPixels>> 318 std::vector<std::unique_ptr<PendingAsyncReadPixels>>
312 pending_async_read_pixels_; 319 pending_async_read_pixels_;
313 320
314 std::unique_ptr<ResourceProvider::ScopedWriteLockGL> 321 std::unique_ptr<ResourceProvider::ScopedWriteLockGL>
315 current_framebuffer_lock_; 322 current_framebuffer_lock_;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 gfx::Size offscreen_stencil_renderbuffer_size_; 354 gfx::Size offscreen_stencil_renderbuffer_size_;
348 355
349 base::WeakPtrFactory<GLRenderer> weak_ptr_factory_; 356 base::WeakPtrFactory<GLRenderer> weak_ptr_factory_;
350 357
351 DISALLOW_COPY_AND_ASSIGN(GLRenderer); 358 DISALLOW_COPY_AND_ASSIGN(GLRenderer);
352 }; 359 };
353 360
354 } // namespace cc 361 } // namespace cc
355 362
356 #endif // CC_OUTPUT_GL_RENDERER_H_ 363 #endif // CC_OUTPUT_GL_RENDERER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/output/gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698