OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |