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

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

Issue 1175113010: cc: Rename visible_content_rect and content stuff on quads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename-visible-content-rect: moreandroid Created 5 years, 6 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/output/gl_renderer.cc ('k') | cc/output/overlay_strategy_single_on_top.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/overlay_strategy_common.h" 5 #include "cc/output/overlay_strategy_common.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "cc/quads/solid_color_draw_quad.h" 9 #include "cc/quads/solid_color_draw_quad.h"
10 #include "cc/quads/stream_video_draw_quad.h" 10 #include "cc/quads/stream_video_draw_quad.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 return solid_quad->ShouldDrawWithBlending() && 43 return solid_quad->ShouldDrawWithBlending() &&
44 alpha < std::numeric_limits<float>::epsilon(); 44 alpha < std::numeric_limits<float>::epsilon();
45 } 45 }
46 return false; 46 return false;
47 } 47 }
48 48
49 bool OverlayStrategyCommon::GetTextureQuadInfo(const TextureDrawQuad& quad, 49 bool OverlayStrategyCommon::GetTextureQuadInfo(const TextureDrawQuad& quad,
50 OverlayCandidate* quad_info) { 50 OverlayCandidate* quad_info) {
51 gfx::OverlayTransform overlay_transform = 51 gfx::OverlayTransform overlay_transform =
52 OverlayCandidate::GetOverlayTransform( 52 OverlayCandidate::GetOverlayTransform(
53 quad.shared_quad_state->content_to_target_transform, quad.y_flipped); 53 quad.shared_quad_state->quad_to_target_transform, quad.y_flipped);
54 if (quad.background_color != SK_ColorTRANSPARENT || 54 if (quad.background_color != SK_ColorTRANSPARENT ||
55 quad.premultiplied_alpha || 55 quad.premultiplied_alpha ||
56 overlay_transform == gfx::OVERLAY_TRANSFORM_INVALID) 56 overlay_transform == gfx::OVERLAY_TRANSFORM_INVALID)
57 return false; 57 return false;
58 quad_info->resource_id = quad.resource_id(); 58 quad_info->resource_id = quad.resource_id();
59 quad_info->resource_size_in_pixels = quad.resource_size_in_pixels(); 59 quad_info->resource_size_in_pixels = quad.resource_size_in_pixels();
60 quad_info->transform = overlay_transform; 60 quad_info->transform = overlay_transform;
61 quad_info->uv_rect = BoundingRect(quad.uv_top_left, quad.uv_bottom_right); 61 quad_info->uv_rect = BoundingRect(quad.uv_top_left, quad.uv_bottom_right);
62 return true; 62 return true;
63 } 63 }
64 64
65 bool OverlayStrategyCommon::GetVideoQuadInfo(const StreamVideoDrawQuad& quad, 65 bool OverlayStrategyCommon::GetVideoQuadInfo(const StreamVideoDrawQuad& quad,
66 OverlayCandidate* quad_info) { 66 OverlayCandidate* quad_info) {
67 gfx::OverlayTransform overlay_transform = 67 gfx::OverlayTransform overlay_transform =
68 OverlayCandidate::GetOverlayTransform( 68 OverlayCandidate::GetOverlayTransform(
69 quad.shared_quad_state->content_to_target_transform, false); 69 quad.shared_quad_state->quad_to_target_transform, false);
70 if (overlay_transform == gfx::OVERLAY_TRANSFORM_INVALID) 70 if (overlay_transform == gfx::OVERLAY_TRANSFORM_INVALID)
71 return false; 71 return false;
72 if (!quad.matrix.IsScaleOrTranslation()) { 72 if (!quad.matrix.IsScaleOrTranslation()) {
73 // We cannot handle anything other than scaling & translation for texture 73 // We cannot handle anything other than scaling & translation for texture
74 // coordinates yet. 74 // coordinates yet.
75 return false; 75 return false;
76 } 76 }
77 quad_info->resource_id = quad.resource_id(); 77 quad_info->resource_id = quad.resource_id();
78 quad_info->resource_size_in_pixels = quad.resource_size_in_pixels(); 78 quad_info->resource_size_in_pixels = quad.resource_size_in_pixels();
79 quad_info->transform = overlay_transform; 79 quad_info->transform = overlay_transform;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 return false; 118 return false;
119 } else if (draw_quad.material == DrawQuad::STREAM_VIDEO_CONTENT) { 119 } else if (draw_quad.material == DrawQuad::STREAM_VIDEO_CONTENT) {
120 const StreamVideoDrawQuad& quad = 120 const StreamVideoDrawQuad& quad =
121 *StreamVideoDrawQuad::MaterialCast(&draw_quad); 121 *StreamVideoDrawQuad::MaterialCast(&draw_quad);
122 if (!GetVideoQuadInfo(quad, quad_info)) 122 if (!GetVideoQuadInfo(quad, quad_info))
123 return false; 123 return false;
124 } 124 }
125 125
126 quad_info->format = RGBA_8888; 126 quad_info->format = RGBA_8888;
127 quad_info->display_rect = OverlayCandidate::GetOverlayRect( 127 quad_info->display_rect = OverlayCandidate::GetOverlayRect(
128 draw_quad.shared_quad_state->content_to_target_transform, draw_quad.rect); 128 draw_quad.shared_quad_state->quad_to_target_transform, draw_quad.rect);
129 return true; 129 return true;
130 } 130 }
131 131
132 } // namespace cc 132 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/gl_renderer.cc ('k') | cc/output/overlay_strategy_single_on_top.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698