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

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

Issue 2168693002: cc: Add OverlayStrategyFullscreen strategy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set deps. Don't enable strategy by default. Created 4 years, 5 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/cc.gyp ('k') | cc/output/overlay_strategy_fullscreen.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_candidate.h" 5 #include "cc/output/overlay_candidate.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 candidate); 210 candidate);
211 default: 211 default:
212 break; 212 break;
213 } 213 }
214 214
215 return false; 215 return false;
216 } 216 }
217 217
218 // static 218 // static
219 bool OverlayCandidate::IsInvisibleQuad(const DrawQuad* quad) { 219 bool OverlayCandidate::IsInvisibleQuad(const DrawQuad* quad) {
220 float opacity = quad->shared_quad_state->opacity;
221 if (opacity < std::numeric_limits<float>::epsilon())
222 return true;
220 if (quad->material == DrawQuad::SOLID_COLOR) { 223 if (quad->material == DrawQuad::SOLID_COLOR) {
221 SkColor color = SolidColorDrawQuad::MaterialCast(quad)->color; 224 SkColor color = SolidColorDrawQuad::MaterialCast(quad)->color;
222 float opacity = quad->shared_quad_state->opacity;
223 float alpha = (SkColorGetA(color) * (1.0f / 255.0f)) * opacity; 225 float alpha = (SkColorGetA(color) * (1.0f / 255.0f)) * opacity;
224 return quad->ShouldDrawWithBlending() && 226 return quad->ShouldDrawWithBlending() &&
225 alpha < std::numeric_limits<float>::epsilon(); 227 alpha < std::numeric_limits<float>::epsilon();
226 } 228 }
227 return false; 229 return false;
228 } 230 }
229 231
230 // static 232 // static
231 bool OverlayCandidate::IsOccluded(const OverlayCandidate& candidate, 233 bool OverlayCandidate::IsOccluded(const OverlayCandidate& candidate,
232 QuadList::ConstIterator quad_list_begin, 234 QuadList::ConstIterator quad_list_begin,
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 candidate->uv_rect = gfx::RectF(uv0.x(), uv1.y(), delta.x(), -delta.y()); 304 candidate->uv_rect = gfx::RectF(uv0.x(), uv1.y(), delta.x(), -delta.y());
303 } else { 305 } else {
304 candidate->transform = ComposeTransforms( 306 candidate->transform = ComposeTransforms(
305 gfx::OVERLAY_TRANSFORM_FLIP_VERTICAL, candidate->transform); 307 gfx::OVERLAY_TRANSFORM_FLIP_VERTICAL, candidate->transform);
306 candidate->uv_rect = gfx::RectF(uv0.x(), uv0.y(), delta.x(), delta.y()); 308 candidate->uv_rect = gfx::RectF(uv0.x(), uv0.y(), delta.x(), delta.y());
307 } 309 }
308 return true; 310 return true;
309 } 311 }
310 312
311 } // namespace cc 313 } // namespace cc
OLDNEW
« no previous file with comments | « cc/cc.gyp ('k') | cc/output/overlay_strategy_fullscreen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698