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

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

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

Powered by Google App Engine
This is Rietveld 408576698