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

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

Issue 1311013002: [Ozone] Fix SingleOnTop issue by checking if the quad is clipped. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 if (overlay_transform == gfx::OVERLAY_TRANSFORM_INVALID) 92 if (overlay_transform == gfx::OVERLAY_TRANSFORM_INVALID)
93 return false; 93 return false;
94 if (!quad.matrix.IsScaleOrTranslation()) { 94 if (!quad.matrix.IsScaleOrTranslation()) {
95 // We cannot handle anything other than scaling & translation for texture 95 // We cannot handle anything other than scaling & translation for texture
96 // coordinates yet. 96 // coordinates yet.
97 return false; 97 return false;
98 } 98 }
99 quad_info->resource_id = quad.resource_id(); 99 quad_info->resource_id = quad.resource_id();
100 quad_info->resource_size_in_pixels = quad.resource_size_in_pixels(); 100 quad_info->resource_size_in_pixels = quad.resource_size_in_pixels();
101 quad_info->transform = overlay_transform; 101 quad_info->transform = overlay_transform;
102 quad_info->original_visible_rect = quad.visible_rect;
103 quad_info->actual_visible_rect =
104 quad.shared_quad_state->visible_quad_layer_rect;
102 105
103 gfx::Point3F uv0 = gfx::Point3F(0, 0, 0); 106 gfx::Point3F uv0 = gfx::Point3F(0, 0, 0);
104 gfx::Point3F uv1 = gfx::Point3F(1, 1, 0); 107 gfx::Point3F uv1 = gfx::Point3F(1, 1, 0);
105 quad.matrix.TransformPoint(&uv0); 108 quad.matrix.TransformPoint(&uv0);
106 quad.matrix.TransformPoint(&uv1); 109 quad.matrix.TransformPoint(&uv1);
107 gfx::Vector3dF delta = uv1 - uv0; 110 gfx::Vector3dF delta = uv1 - uv0;
108 if (delta.x() < 0) { 111 if (delta.x() < 0) {
109 quad_info->transform = OverlayCandidate::ModifyTransform( 112 quad_info->transform = OverlayCandidate::ModifyTransform(
110 quad_info->transform, gfx::OVERLAY_TRANSFORM_FLIP_HORIZONTAL); 113 quad_info->transform, gfx::OVERLAY_TRANSFORM_FLIP_HORIZONTAL);
111 float x0 = uv0.x(); 114 float x0 = uv0.x();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 return false; 148 return false;
146 } 149 }
147 150
148 quad_info->format = RGBA_8888; 151 quad_info->format = RGBA_8888;
149 quad_info->display_rect = OverlayCandidate::GetOverlayRect( 152 quad_info->display_rect = OverlayCandidate::GetOverlayRect(
150 draw_quad.shared_quad_state->quad_to_target_transform, draw_quad.rect); 153 draw_quad.shared_quad_state->quad_to_target_transform, draw_quad.rect);
151 return true; 154 return true;
152 } 155 }
153 156
154 } // namespace cc 157 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698