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

Side by Side Diff: cc/output/gl_renderer.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/base/math_util.cc ('k') | cc/output/overlay_candidate.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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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/gl_renderer.h" 5 #include "cc/output/gl_renderer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 return true; 65 return true;
66 #else 66 #else
67 return false; 67 return false;
68 #endif 68 #endif
69 } 69 }
70 70
71 Float4 UVTransform(const TextureDrawQuad* quad) { 71 Float4 UVTransform(const TextureDrawQuad* quad) {
72 gfx::PointF uv0 = quad->uv_top_left; 72 gfx::PointF uv0 = quad->uv_top_left;
73 gfx::PointF uv1 = quad->uv_bottom_right; 73 gfx::PointF uv1 = quad->uv_bottom_right;
74 Float4 xform = {{uv0.x(), uv0.y(), uv1.x() - uv0.x(), uv1.y() - uv0.y()}}; 74 Float4 xform = {{uv0.x(), uv0.y(), uv1.x() - uv0.x(), uv1.y() - uv0.y()}};
75 if (quad->flipped) { 75 if (quad->y_flipped) {
76 xform.data[1] = 1.0f - xform.data[1]; 76 xform.data[1] = 1.0f - xform.data[1];
77 xform.data[3] = -xform.data[3]; 77 xform.data[3] = -xform.data[3];
78 } 78 }
79 return xform; 79 return xform;
80 } 80 }
81 81
82 Float4 PremultipliedColor(SkColor color) { 82 Float4 PremultipliedColor(SkColor color) {
83 const float factor = 1.0f / 255.0f; 83 const float factor = 1.0f / 255.0f;
84 const float alpha = SkColorGetA(color) * factor; 84 const float alpha = SkColorGetA(color) * factor;
85 85
(...skipping 3415 matching lines...) Expand 10 before | Expand all | Expand 10 after
3501 context_support_->ScheduleOverlayPlane( 3501 context_support_->ScheduleOverlayPlane(
3502 overlay.plane_z_order, 3502 overlay.plane_z_order,
3503 overlay.transform, 3503 overlay.transform,
3504 pending_overlay_resources_.back()->texture_id(), 3504 pending_overlay_resources_.back()->texture_id(),
3505 ToNearestRect(overlay.display_rect), 3505 ToNearestRect(overlay.display_rect),
3506 overlay.uv_rect); 3506 overlay.uv_rect);
3507 } 3507 }
3508 } 3508 }
3509 3509
3510 } // namespace cc 3510 } // namespace cc
OLDNEW
« no previous file with comments | « cc/base/math_util.cc ('k') | cc/output/overlay_candidate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698