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" |
11 #include "base/containers/scoped_ptr_hash_map.h" | 11 #include "base/containers/scoped_ptr_hash_map.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "base/numerics/safe_conversions.h" |
13 #include "base/trace_event/trace_event.h" | 14 #include "base/trace_event/trace_event.h" |
14 #include "cc/base/math_util.h" | 15 #include "cc/base/math_util.h" |
15 #include "cc/output/bsp_tree.h" | 16 #include "cc/output/bsp_tree.h" |
16 #include "cc/output/bsp_walk_action.h" | 17 #include "cc/output/bsp_walk_action.h" |
17 #include "cc/output/copy_output_request.h" | 18 #include "cc/output/copy_output_request.h" |
18 #include "cc/quads/draw_quad.h" | 19 #include "cc/quads/draw_quad.h" |
19 #include "ui/gfx/geometry/rect_conversions.h" | 20 #include "ui/gfx/geometry/rect_conversions.h" |
20 #include "ui/gfx/transform.h" | 21 #include "ui/gfx/transform.h" |
21 | 22 |
22 static gfx::Transform OrthoProjectionMatrix(float left, | 23 static gfx::Transform OrthoProjectionMatrix(float left, |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 } | 187 } |
187 } | 188 } |
188 } | 189 } |
189 | 190 |
190 void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order, | 191 void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order, |
191 float device_scale_factor, | 192 float device_scale_factor, |
192 const gfx::Rect& device_viewport_rect, | 193 const gfx::Rect& device_viewport_rect, |
193 const gfx::Rect& device_clip_rect, | 194 const gfx::Rect& device_clip_rect, |
194 bool disable_picture_quad_image_filtering) { | 195 bool disable_picture_quad_image_filtering) { |
195 TRACE_EVENT0("cc", "DirectRenderer::DrawFrame"); | 196 TRACE_EVENT0("cc", "DirectRenderer::DrawFrame"); |
196 UMA_HISTOGRAM_COUNTS("Renderer4.renderPassCount", | 197 UMA_HISTOGRAM_COUNTS( |
197 render_passes_in_draw_order->size()); | 198 "Renderer4.renderPassCount", |
| 199 base::sautrated_cast<int>(render_passes_in_draw_order->size())); |
198 | 200 |
199 const RenderPass* root_render_pass = render_passes_in_draw_order->back(); | 201 const RenderPass* root_render_pass = render_passes_in_draw_order->back(); |
200 DCHECK(root_render_pass); | 202 DCHECK(root_render_pass); |
201 | 203 |
202 DrawingFrame frame; | 204 DrawingFrame frame; |
203 frame.render_passes_in_draw_order = render_passes_in_draw_order; | 205 frame.render_passes_in_draw_order = render_passes_in_draw_order; |
204 frame.root_render_pass = root_render_pass; | 206 frame.root_render_pass = root_render_pass; |
205 frame.root_damage_rect = Capabilities().using_partial_swap | 207 frame.root_damage_rect = Capabilities().using_partial_swap |
206 ? root_render_pass->damage_rect | 208 ? root_render_pass->damage_rect |
207 : root_render_pass->output_rect; | 209 : root_render_pass->output_rect; |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 ScopedResource* texture = render_pass_textures_.get(id); | 520 ScopedResource* texture = render_pass_textures_.get(id); |
519 return texture && texture->id(); | 521 return texture && texture->id(); |
520 } | 522 } |
521 | 523 |
522 // static | 524 // static |
523 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { | 525 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { |
524 return render_pass->output_rect.size(); | 526 return render_pass->output_rect.size(); |
525 } | 527 } |
526 | 528 |
527 } // namespace cc | 529 } // namespace cc |
OLD | NEW |