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

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

Issue 2697863003: color: Clarify default behaviors (Closed)
Patch Set: Incorporate review feedback 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 | « cc/ipc/struct_traits_unittest.cc ('k') | chromecast/media/cma/base/decoder_config_adapter.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 #include "cc/output/gl_renderer.h" 5 #include "cc/output/gl_renderer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after
2102 src_color_space = gfx::ColorSpace::CreateREC601(); 2102 src_color_space = gfx::ColorSpace::CreateREC601();
2103 break; 2103 break;
2104 case YUVVideoDrawQuad::REC_709: 2104 case YUVVideoDrawQuad::REC_709:
2105 src_color_space = gfx::ColorSpace::CreateREC709(); 2105 src_color_space = gfx::ColorSpace::CreateREC709();
2106 break; 2106 break;
2107 case YUVVideoDrawQuad::JPEG: 2107 case YUVVideoDrawQuad::JPEG:
2108 src_color_space = gfx::ColorSpace::CreateJpeg(); 2108 src_color_space = gfx::ColorSpace::CreateJpeg();
2109 break; 2109 break;
2110 } 2110 }
2111 } 2111 }
2112 // Invalid or unspecified color spaces should be treated as REC709.
2113 if (!src_color_space.IsValid())
2114 src_color_space = gfx::ColorSpace::CreateREC709();
2112 2115
2113 ResourceProvider::ScopedSamplerGL y_plane_lock( 2116 ResourceProvider::ScopedSamplerGL y_plane_lock(
2114 resource_provider_, quad->y_plane_resource_id(), GL_TEXTURE1, GL_LINEAR); 2117 resource_provider_, quad->y_plane_resource_id(), GL_TEXTURE1, GL_LINEAR);
2115 ResourceProvider::ScopedSamplerGL u_plane_lock( 2118 ResourceProvider::ScopedSamplerGL u_plane_lock(
2116 resource_provider_, quad->u_plane_resource_id(), GL_TEXTURE2, GL_LINEAR); 2119 resource_provider_, quad->u_plane_resource_id(), GL_TEXTURE2, GL_LINEAR);
2117 DCHECK_EQ(y_plane_lock.target(), u_plane_lock.target()); 2120 DCHECK_EQ(y_plane_lock.target(), u_plane_lock.target());
2118 // TODO(jbauman): Use base::Optional when available. 2121 // TODO(jbauman): Use base::Optional when available.
2119 std::unique_ptr<ResourceProvider::ScopedSamplerGL> v_plane_lock; 2122 std::unique_ptr<ResourceProvider::ScopedSamplerGL> v_plane_lock;
2120 2123
2121 if (uv_texture_mode == UV_TEXTURE_MODE_U_V) { 2124 if (uv_texture_mode == UV_TEXTURE_MODE_U_V) {
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after
3527 return; 3530 return;
3528 3531
3529 // Report GPU overdraw as a percentage of |max_result|. 3532 // Report GPU overdraw as a percentage of |max_result|.
3530 TRACE_COUNTER1( 3533 TRACE_COUNTER1(
3531 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw", 3534 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw",
3532 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) / 3535 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) /
3533 max_result); 3536 max_result);
3534 } 3537 }
3535 3538
3536 } // namespace cc 3539 } // namespace cc
OLDNEW
« no previous file with comments | « cc/ipc/struct_traits_unittest.cc ('k') | chromecast/media/cma/base/decoder_config_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698