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

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

Issue 2109333005: Use 'int' content quad coordinates all the way. (not for commit) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | no next file » | 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 2041 matching lines...) Expand 10 before | Expand all | Expand 10 after
2052 (tile_quad.p1().x() - top_left.x()) / width, 2052 (tile_quad.p1().x() - top_left.x()) / width,
2053 (tile_quad.p1().y() - top_left.y()) / height, 2053 (tile_quad.p1().y() - top_left.y()) / height,
2054 (tile_quad.p2().x() - top_left.x()) / width, 2054 (tile_quad.p2().x() - top_left.x()) / width,
2055 (tile_quad.p2().y() - top_left.y()) / height, 2055 (tile_quad.p2().y() - top_left.y()) / height,
2056 (tile_quad.p3().x() - top_left.x()) / width, 2056 (tile_quad.p3().x() - top_left.x()) / width,
2057 (tile_quad.p3().y() - top_left.y()) / height, 2057 (tile_quad.p3().y() - top_left.y()) / height,
2058 }; 2058 };
2059 PrepareGeometry(CLIPPED_BINDING); 2059 PrepareGeometry(CLIPPED_BINDING);
2060 clipped_geometry_->InitializeCustomQuadWithUVs( 2060 clipped_geometry_->InitializeCustomQuadWithUVs(
2061 gfx::QuadF(gfx::RectF(quad->visible_rect)), gl_uv); 2061 gfx::QuadF(gfx::RectF(quad->visible_rect)), gl_uv);
2062 float gl_quad[8] = {
2063 tile_quad.p4().x(), tile_quad.p4().y(), tile_quad.p1().x(),
2064 tile_quad.p1().y(), tile_quad.p2().x(), tile_quad.p2().y(),
2065 tile_quad.p3().x(), tile_quad.p3().y(),
2066 };
2067 gl_->Uniform2fv(uniforms.quad_location, 4, gl_quad);
2062 } else { 2068 } else {
2063 PrepareGeometry(SHARED_BINDING); 2069 PrepareGeometry(SHARED_BINDING);
2070 float gl_quad[8] = {
2071 quad->visible_rect.bottom_left().x(),
2072 quad->visible_rect.bottom_left().y(),
2073 quad->visible_rect.origin().x(),
2074 quad->visible_rect.origin().y(),
2075 quad->visible_rect.top_right().x(),
2076 quad->visible_rect.top_right().y(),
2077 quad->visible_rect.bottom_right().x(),
2078 quad->visible_rect.bottom_right().y(),
2079 };
2080 gl_->Uniform2fv(uniforms.quad_location, 4, gl_quad);
2064 } 2081 }
2065 float gl_quad[8] = {
2066 tile_quad.p4().x(), tile_quad.p4().y(), tile_quad.p1().x(),
2067 tile_quad.p1().y(), tile_quad.p2().x(), tile_quad.p2().y(),
2068 tile_quad.p3().x(), tile_quad.p3().y(),
2069 };
2070 gl_->Uniform2fv(uniforms.quad_location, 4, gl_quad);
2071 2082
2072 static float gl_matrix[16]; 2083 static float gl_matrix[16];
2073 ToGLMatrix(&gl_matrix[0], 2084 ToGLMatrix(&gl_matrix[0],
2074 frame->projection_matrix * 2085 frame->projection_matrix *
2075 quad->shared_quad_state->quad_to_target_transform); 2086 quad->shared_quad_state->quad_to_target_transform);
2076 gl_->UniformMatrix4fv(uniforms.matrix_location, 1, false, &gl_matrix[0]); 2087 gl_->UniformMatrix4fv(uniforms.matrix_location, 1, false, &gl_matrix[0]);
2077 2088
2078 gl_->DrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0); 2089 gl_->DrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);
2079 } 2090 }
2080 2091
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after
3686 texture_id = pending_overlay_resources_.back()->texture_id(); 3697 texture_id = pending_overlay_resources_.back()->texture_id();
3687 } 3698 }
3688 3699
3689 context_support_->ScheduleOverlayPlane( 3700 context_support_->ScheduleOverlayPlane(
3690 overlay.plane_z_order, overlay.transform, texture_id, 3701 overlay.plane_z_order, overlay.transform, texture_id,
3691 ToNearestRect(overlay.display_rect), overlay.uv_rect); 3702 ToNearestRect(overlay.display_rect), overlay.uv_rect);
3692 } 3703 }
3693 } 3704 }
3694 3705
3695 } // namespace cc 3706 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698