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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 if (!resource) | 194 if (!resource) |
195 resource = ScopedResource::Create(resource_provider_); | 195 resource = ScopedResource::Create(resource_provider_); |
196 } | 196 } |
197 } | 197 } |
198 | 198 |
199 void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order, | 199 void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order, |
200 float device_scale_factor, | 200 float device_scale_factor, |
201 const gfx::ColorSpace& device_color_space, | 201 const gfx::ColorSpace& device_color_space, |
202 const gfx::Rect& device_viewport_rect, | 202 const gfx::Rect& device_viewport_rect, |
203 const gfx::Rect& device_clip_rect) { | 203 const gfx::Rect& device_clip_rect) { |
| 204 DCHECK(visible()); |
204 TRACE_EVENT0("cc", "DirectRenderer::DrawFrame"); | 205 TRACE_EVENT0("cc", "DirectRenderer::DrawFrame"); |
205 UMA_HISTOGRAM_COUNTS( | 206 UMA_HISTOGRAM_COUNTS( |
206 "Renderer4.renderPassCount", | 207 "Renderer4.renderPassCount", |
207 base::saturated_cast<int>(render_passes_in_draw_order->size())); | 208 base::saturated_cast<int>(render_passes_in_draw_order->size())); |
208 | 209 |
209 RenderPass* root_render_pass = render_passes_in_draw_order->back().get(); | 210 RenderPass* root_render_pass = render_passes_in_draw_order->back().get(); |
210 DCHECK(root_render_pass); | 211 DCHECK(root_render_pass); |
211 | 212 |
212 DrawingFrame frame; | 213 DrawingFrame frame; |
213 frame.render_passes_in_draw_order = render_passes_in_draw_order; | 214 frame.render_passes_in_draw_order = render_passes_in_draw_order; |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 auto iter = render_pass_textures_.find(id); | 572 auto iter = render_pass_textures_.find(id); |
572 return iter != render_pass_textures_.end() && iter->second->id(); | 573 return iter != render_pass_textures_.end() && iter->second->id(); |
573 } | 574 } |
574 | 575 |
575 // static | 576 // static |
576 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { | 577 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { |
577 return render_pass->output_rect.size(); | 578 return render_pass->output_rect.size(); |
578 } | 579 } |
579 | 580 |
580 } // namespace cc | 581 } // namespace cc |
OLD | NEW |