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

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

Issue 1135813005: Add detection for rotation and flip overlay transforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mojo surfaces unit test, chase flipped rename to TextureQuadState Created 5 years, 7 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/overlay_candidate.cc ('k') | cc/output/overlay_unittest.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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 float alpha = (SkColorGetA(color) * (1.0f / 255.0f)) * opacity; 49 float alpha = (SkColorGetA(color) * (1.0f / 255.0f)) * opacity;
50 return solid_quad->ShouldDrawWithBlending() && 50 return solid_quad->ShouldDrawWithBlending() &&
51 alpha < std::numeric_limits<float>::epsilon(); 51 alpha < std::numeric_limits<float>::epsilon();
52 } 52 }
53 return false; 53 return false;
54 } 54 }
55 55
56 bool OverlayStrategyCommon::GetTextureQuadInfo(const TextureDrawQuad& quad, 56 bool OverlayStrategyCommon::GetTextureQuadInfo(const TextureDrawQuad& quad,
57 OverlayCandidate* quad_info) { 57 OverlayCandidate* quad_info) {
58 gfx::OverlayTransform overlay_transform = 58 gfx::OverlayTransform overlay_transform =
59 OverlayCandidate::GetOverlayTransform(quad.quadTransform(), quad.flipped); 59 OverlayCandidate::GetOverlayTransform(quad.quadTransform(),
60 quad.y_flipped);
60 if (quad.background_color != SK_ColorTRANSPARENT || 61 if (quad.background_color != SK_ColorTRANSPARENT ||
61 quad.premultiplied_alpha || 62 quad.premultiplied_alpha ||
62 overlay_transform == gfx::OVERLAY_TRANSFORM_INVALID) 63 overlay_transform == gfx::OVERLAY_TRANSFORM_INVALID)
63 return false; 64 return false;
64 quad_info->resource_id = quad.resource_id; 65 quad_info->resource_id = quad.resource_id;
65 quad_info->transform = overlay_transform; 66 quad_info->transform = overlay_transform;
66 quad_info->uv_rect = BoundingRect(quad.uv_top_left, quad.uv_bottom_right); 67 quad_info->uv_rect = BoundingRect(quad.uv_top_left, quad.uv_bottom_right);
67 return true; 68 return true;
68 } 69 }
69 70
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 return false; 127 return false;
127 } 128 }
128 129
129 quad_info->format = RGBA_8888; 130 quad_info->format = RGBA_8888;
130 quad_info->display_rect = OverlayCandidate::GetOverlayRect( 131 quad_info->display_rect = OverlayCandidate::GetOverlayRect(
131 draw_quad.quadTransform(), draw_quad.rect); 132 draw_quad.quadTransform(), draw_quad.rect);
132 return true; 133 return true;
133 } 134 }
134 135
135 } // namespace cc 136 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/overlay_candidate.cc ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698