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

Unified Diff: cc/output/gl_renderer.cc

Issue 2728173004: HDR: Do nonlinear blending in the compositor (Closed)
Patch Set: Fix windows build Created 3 years, 9 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_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index 1eac5f85d19fd7268dc7b9c2d33a9288ab115f9b..a1108a872d0284079c6026fe93f7daa81b31c87d 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -425,8 +425,10 @@ bool GLRenderer::CanPartialSwap() {
}
ResourceFormat GLRenderer::BackbufferFormat() const {
- // TODO(ccameron): If we are targeting high bit depth or HDR, we should use
- // RGBA_F16 here.
+ if (current_frame()->current_render_pass->color_space.IsHDR() &&
+ resource_provider_->IsResourceFormatSupported(RGBA_F16)) {
+ return RGBA_F16;
+ }
return resource_provider_->best_texture_format();
}
@@ -1313,7 +1315,9 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params) {
tex_coord_precision, sampler_type, shader_blend_mode,
params->use_aa ? USE_AA : NO_AA, mask_mode,
mask_for_background, params->use_color_matrix),
- current_frame()->current_render_pass->color_space);
+ params->contents_resource_lock
+ ? params->contents_resource_lock->color_space()
+ : gfx::ColorSpace());
}
void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) {
« no previous file with comments | « no previous file | cc/output/gl_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698