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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // Map from ([-1, -1] to [1, 1]) -> ([0, 0] to [1, 1]) | 50 // Map from ([-1, -1] to [1, 1]) -> ([0, 0] to [1, 1]) |
51 canvas.Translate3d(0.5, 0.5, 0.5); | 51 canvas.Translate3d(0.5, 0.5, 0.5); |
52 canvas.Scale3d(0.5, 0.5, 0.5); | 52 canvas.Scale3d(0.5, 0.5, 0.5); |
53 | 53 |
54 return canvas; | 54 return canvas; |
55 } | 55 } |
56 | 56 |
57 namespace cc { | 57 namespace cc { |
58 | 58 |
59 DirectRenderer::DrawingFrame::DrawingFrame() | 59 DirectRenderer::DrawingFrame::DrawingFrame() |
60 : root_render_pass(NULL), current_render_pass(NULL), current_texture(NULL) { | 60 : root_render_pass(nullptr), |
| 61 current_render_pass(nullptr), |
| 62 current_texture(nullptr) { |
61 } | 63 } |
62 | 64 |
63 DirectRenderer::DrawingFrame::~DrawingFrame() {} | 65 DirectRenderer::DrawingFrame::~DrawingFrame() {} |
64 | 66 |
65 // | 67 // |
66 // static | 68 // static |
67 gfx::RectF DirectRenderer::QuadVertexRect() { | 69 gfx::RectF DirectRenderer::QuadVertexRect() { |
68 return gfx::RectF(-0.5f, -0.5f, 1.f, 1.f); | 70 return gfx::RectF(-0.5f, -0.5f, 1.f, 1.f); |
69 } | 71 } |
70 | 72 |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 385 |
384 if (!should_skip_quad) | 386 if (!should_skip_quad) |
385 DoDrawQuad(frame, &quad); | 387 DoDrawQuad(frame, &quad); |
386 } | 388 } |
387 FinishDrawingQuadList(); | 389 FinishDrawingQuadList(); |
388 } | 390 } |
389 | 391 |
390 bool DirectRenderer::UseRenderPass(DrawingFrame* frame, | 392 bool DirectRenderer::UseRenderPass(DrawingFrame* frame, |
391 const RenderPass* render_pass) { | 393 const RenderPass* render_pass) { |
392 frame->current_render_pass = render_pass; | 394 frame->current_render_pass = render_pass; |
393 frame->current_texture = NULL; | 395 frame->current_texture = nullptr; |
394 | 396 |
395 if (render_pass == frame->root_render_pass) { | 397 if (render_pass == frame->root_render_pass) { |
396 BindFramebufferToOutputSurface(frame); | 398 BindFramebufferToOutputSurface(frame); |
397 InitializeViewport(frame, | 399 InitializeViewport(frame, |
398 render_pass->output_rect, | 400 render_pass->output_rect, |
399 frame->device_viewport_rect, | 401 frame->device_viewport_rect, |
400 output_surface_->SurfaceSize()); | 402 output_surface_->SurfaceSize()); |
401 return true; | 403 return true; |
402 } | 404 } |
403 | 405 |
(...skipping 15 matching lines...) Expand all Loading... |
419 ScopedResource* texture = render_pass_textures_.get(id); | 421 ScopedResource* texture = render_pass_textures_.get(id); |
420 return texture && texture->id(); | 422 return texture && texture->id(); |
421 } | 423 } |
422 | 424 |
423 // static | 425 // static |
424 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { | 426 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { |
425 return render_pass->output_rect.size(); | 427 return render_pass->output_rect.size(); |
426 } | 428 } |
427 | 429 |
428 } // namespace cc | 430 } // namespace cc |
OLD | NEW |