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

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

Issue 1381603003: Mac Overlays: Clip display and UV rects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2490
Patch Set: Created 5 years, 2 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 | cc/output/overlay_strategy_sandwich.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/io_surface_draw_quad.h" 9 #include "cc/quads/io_surface_draw_quad.h"
10 #include "cc/quads/solid_color_draw_quad.h" 10 #include "cc/quads/solid_color_draw_quad.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 if (!quad.allow_overlay) 153 if (!quad.allow_overlay)
154 return false; 154 return false;
155 gfx::OverlayTransform overlay_transform = 155 gfx::OverlayTransform overlay_transform =
156 OverlayCandidate::GetOverlayTransform( 156 OverlayCandidate::GetOverlayTransform(
157 quad.shared_quad_state->quad_to_target_transform, false); 157 quad.shared_quad_state->quad_to_target_transform, false);
158 if (overlay_transform != gfx::OVERLAY_TRANSFORM_NONE) 158 if (overlay_transform != gfx::OVERLAY_TRANSFORM_NONE)
159 return false; 159 return false;
160 quad_info->resource_id = quad.io_surface_resource_id(); 160 quad_info->resource_id = quad.io_surface_resource_id();
161 quad_info->resource_size_in_pixels = quad.io_surface_size; 161 quad_info->resource_size_in_pixels = quad.io_surface_size;
162 quad_info->transform = overlay_transform; 162 quad_info->transform = overlay_transform;
163 quad_info->uv_rect = gfx::Rect(0, 0, 1, 1); 163 quad_info->uv_rect = gfx::RectF(1.f, 1.f);
164 return true; 164 return true;
165 } 165 }
166 166
167 bool OverlayStrategyCommon::GetCandidateQuadInfo(const DrawQuad& draw_quad, 167 bool OverlayStrategyCommon::GetCandidateQuadInfo(const DrawQuad& draw_quad,
168 OverlayCandidate* quad_info) { 168 OverlayCandidate* quad_info) {
169 // All quad checks. 169 // All quad checks.
170 if (draw_quad.needs_blending || draw_quad.shared_quad_state->opacity != 1.f || 170 if (draw_quad.needs_blending || draw_quad.shared_quad_state->opacity != 1.f ||
171 draw_quad.shared_quad_state->blend_mode != SkXfermode::kSrcOver_Mode) 171 draw_quad.shared_quad_state->blend_mode != SkXfermode::kSrcOver_Mode)
172 return false; 172 return false;
173 173
(...skipping 13 matching lines...) Expand all
187 if (!GetIOSurfaceQuadInfo(*quad, quad_info)) 187 if (!GetIOSurfaceQuadInfo(*quad, quad_info))
188 return false; 188 return false;
189 } break; 189 } break;
190 default: 190 default:
191 return false; 191 return false;
192 } 192 }
193 193
194 quad_info->format = RGBA_8888; 194 quad_info->format = RGBA_8888;
195 quad_info->display_rect = OverlayCandidate::GetOverlayRect( 195 quad_info->display_rect = OverlayCandidate::GetOverlayRect(
196 draw_quad.shared_quad_state->quad_to_target_transform, draw_quad.rect); 196 draw_quad.shared_quad_state->quad_to_target_transform, draw_quad.rect);
197 quad_info->quad_rect_in_target_space = MathUtil::MapEnclosingClippedRect(
198 draw_quad.shared_quad_state->quad_to_target_transform, draw_quad.rect);
199 quad_info->clip_rect = draw_quad.shared_quad_state->clip_rect;
200 quad_info->is_clipped = draw_quad.shared_quad_state->is_clipped;
197 return true; 201 return true;
198 } 202 }
199 203
200 } // namespace cc 204 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/output/overlay_strategy_sandwich.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698