| OLD | NEW |
| 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 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1871 vertex_tex_scale_y); | 1871 vertex_tex_scale_y); |
| 1872 | 1872 |
| 1873 SetBlendEnabled(quad->ShouldDrawWithBlending()); | 1873 SetBlendEnabled(quad->ShouldDrawWithBlending()); |
| 1874 | 1874 |
| 1875 SetShaderOpacity(quad->shared_quad_state->opacity, uniforms.alpha_location); | 1875 SetShaderOpacity(quad->shared_quad_state->opacity, uniforms.alpha_location); |
| 1876 | 1876 |
| 1877 // Pass quad coordinates to the uniform in the same order as GeometryBinding | 1877 // Pass quad coordinates to the uniform in the same order as GeometryBinding |
| 1878 // does, then vertices will match the texture mapping in the vertex buffer. | 1878 // does, then vertices will match the texture mapping in the vertex buffer. |
| 1879 // The method SetShaderQuadF() changes the order of vertices and so it's | 1879 // The method SetShaderQuadF() changes the order of vertices and so it's |
| 1880 // not used here. | 1880 // not used here. |
| 1881 gfx::QuadF tile_quad(gfx::RectF(quad->visible_rect)); | 1881 auto tile_quad = gfx::QuadF(gfx::RectF(quad->visible_rect)); |
| 1882 float width = quad->visible_rect.width(); | 1882 float width = quad->visible_rect.width(); |
| 1883 float height = quad->visible_rect.height(); | 1883 float height = quad->visible_rect.height(); |
| 1884 gfx::PointF top_left = quad->visible_rect.origin(); | 1884 auto top_left = gfx::PointF(quad->visible_rect.origin()); |
| 1885 if (clip_region) { | 1885 if (clip_region) { |
| 1886 tile_quad = *clip_region; | 1886 tile_quad = *clip_region; |
| 1887 float gl_uv[8] = { | 1887 float gl_uv[8] = { |
| 1888 (tile_quad.p4().x() - top_left.x()) / width, | 1888 (tile_quad.p4().x() - top_left.x()) / width, |
| 1889 (tile_quad.p4().y() - top_left.y()) / height, | 1889 (tile_quad.p4().y() - top_left.y()) / height, |
| 1890 (tile_quad.p1().x() - top_left.x()) / width, | 1890 (tile_quad.p1().x() - top_left.x()) / width, |
| 1891 (tile_quad.p1().y() - top_left.y()) / height, | 1891 (tile_quad.p1().y() - top_left.y()) / height, |
| 1892 (tile_quad.p2().x() - top_left.x()) / width, | 1892 (tile_quad.p2().x() - top_left.x()) / width, |
| 1893 (tile_quad.p2().y() - top_left.y()) / height, | 1893 (tile_quad.p2().y() - top_left.y()) / height, |
| 1894 (tile_quad.p3().x() - top_left.x()) / width, | 1894 (tile_quad.p3().x() - top_left.x()) / width, |
| (...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3530 texture_id = pending_overlay_resources_.back()->texture_id(); | 3530 texture_id = pending_overlay_resources_.back()->texture_id(); |
| 3531 } | 3531 } |
| 3532 | 3532 |
| 3533 context_support_->ScheduleOverlayPlane( | 3533 context_support_->ScheduleOverlayPlane( |
| 3534 overlay.plane_z_order, overlay.transform, texture_id, | 3534 overlay.plane_z_order, overlay.transform, texture_id, |
| 3535 ToNearestRect(overlay.display_rect), overlay.uv_rect); | 3535 ToNearestRect(overlay.display_rect), overlay.uv_rect); |
| 3536 } | 3536 } |
| 3537 } | 3537 } |
| 3538 | 3538 |
| 3539 } // namespace cc | 3539 } // namespace cc |
| OLD | NEW |