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

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

Issue 145313006: [#7] Pass gfx structs by const ref (gfx::Size) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 10 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/output/direct_renderer.h ('k') | cc/output/gl_renderer.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/direct_renderer.h" 5 #include "cc/output/direct_renderer.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 const gfx::RectF& quad_rect) { 76 const gfx::RectF& quad_rect) {
77 *quad_rect_transform = quad_transform; 77 *quad_rect_transform = quad_transform;
78 quad_rect_transform->Translate(0.5 * quad_rect.width() + quad_rect.x(), 78 quad_rect_transform->Translate(0.5 * quad_rect.width() + quad_rect.x(),
79 0.5 * quad_rect.height() + quad_rect.y()); 79 0.5 * quad_rect.height() + quad_rect.y());
80 quad_rect_transform->Scale(quad_rect.width(), quad_rect.height()); 80 quad_rect_transform->Scale(quad_rect.width(), quad_rect.height());
81 } 81 }
82 82
83 void DirectRenderer::InitializeViewport(DrawingFrame* frame, 83 void DirectRenderer::InitializeViewport(DrawingFrame* frame,
84 const gfx::Rect& draw_rect, 84 const gfx::Rect& draw_rect,
85 const gfx::Rect& viewport_rect, 85 const gfx::Rect& viewport_rect,
86 gfx::Size surface_size) { 86 const gfx::Size& surface_size) {
87 bool flip_y = FlippedFramebuffer(); 87 bool flip_y = FlippedFramebuffer();
88 88
89 DCHECK_GE(viewport_rect.x(), 0); 89 DCHECK_GE(viewport_rect.x(), 0);
90 DCHECK_GE(viewport_rect.y(), 0); 90 DCHECK_GE(viewport_rect.y(), 0);
91 DCHECK_LE(viewport_rect.right(), surface_size.width()); 91 DCHECK_LE(viewport_rect.right(), surface_size.width());
92 DCHECK_LE(viewport_rect.bottom(), surface_size.height()); 92 DCHECK_LE(viewport_rect.bottom(), surface_size.height());
93 if (flip_y) { 93 if (flip_y) {
94 frame->projection_matrix = OrthoProjectionMatrix(draw_rect.x(), 94 frame->projection_matrix = OrthoProjectionMatrix(draw_rect.x(),
95 draw_rect.right(), 95 draw_rect.right(),
96 draw_rect.bottom(), 96 draw_rect.bottom(),
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 ScopedResource* texture = render_pass_textures_.get(id); 421 ScopedResource* texture = render_pass_textures_.get(id);
422 return texture && texture->id(); 422 return texture && texture->id();
423 } 423 }
424 424
425 // static 425 // static
426 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { 426 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) {
427 return render_pass->output_rect.size(); 427 return render_pass->output_rect.size();
428 } 428 }
429 429
430 } // namespace cc 430 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/direct_renderer.h ('k') | cc/output/gl_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698