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/delegating_renderer.h" | 5 #include "cc/output/delegating_renderer.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 : Renderer(client, settings), | 46 : Renderer(client, settings), |
47 output_surface_(output_surface), | 47 output_surface_(output_surface), |
48 resource_provider_(resource_provider), | 48 resource_provider_(resource_provider), |
49 visible_(true) { | 49 visible_(true) { |
50 DCHECK(resource_provider_); | 50 DCHECK(resource_provider_); |
51 | 51 |
52 capabilities_.using_partial_swap = false; | 52 capabilities_.using_partial_swap = false; |
53 capabilities_.max_texture_size = resource_provider_->max_texture_size(); | 53 capabilities_.max_texture_size = resource_provider_->max_texture_size(); |
54 capabilities_.best_texture_format = resource_provider_->best_texture_format(); | 54 capabilities_.best_texture_format = resource_provider_->best_texture_format(); |
55 capabilities_.allow_partial_texture_updates = false; | 55 capabilities_.allow_partial_texture_updates = false; |
56 capabilities_.using_offscreen_context3d = false; | |
57 | 56 |
58 if (!output_surface_->context_provider()) { | 57 if (!output_surface_->context_provider()) { |
59 capabilities_.using_shared_memory_resources = true; | 58 capabilities_.using_shared_memory_resources = true; |
60 capabilities_.using_map_image = true; | 59 capabilities_.using_map_image = true; |
61 } else { | 60 } else { |
62 const ContextProvider::Capabilities& caps = | 61 const ContextProvider::Capabilities& caps = |
63 output_surface_->context_provider()->ContextCapabilities(); | 62 output_surface_->context_provider()->ContextCapabilities(); |
64 | 63 |
65 DCHECK(!caps.gpu.iosurface || caps.gpu.texture_rectangle); | 64 DCHECK(!caps.gpu.iosurface || caps.gpu.texture_rectangle); |
66 | 65 |
(...skipping 14 matching lines...) Expand all Loading... |
81 bool DelegatingRenderer::CanReadPixels() const { return false; } | 80 bool DelegatingRenderer::CanReadPixels() const { return false; } |
82 | 81 |
83 static ResourceProvider::ResourceId AppendToArray( | 82 static ResourceProvider::ResourceId AppendToArray( |
84 ResourceProvider::ResourceIdArray* array, | 83 ResourceProvider::ResourceIdArray* array, |
85 ResourceProvider::ResourceId id) { | 84 ResourceProvider::ResourceId id) { |
86 array->push_back(id); | 85 array->push_back(id); |
87 return id; | 86 return id; |
88 } | 87 } |
89 | 88 |
90 void DelegatingRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order, | 89 void DelegatingRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order, |
91 ContextProvider* offscreen_context_provider, | |
92 float device_scale_factor, | 90 float device_scale_factor, |
93 const gfx::Rect& device_viewport_rect, | 91 const gfx::Rect& device_viewport_rect, |
94 const gfx::Rect& device_clip_rect, | 92 const gfx::Rect& device_clip_rect, |
95 bool disable_picture_quad_image_filtering) { | 93 bool disable_picture_quad_image_filtering) { |
96 TRACE_EVENT0("cc", "DelegatingRenderer::DrawFrame"); | 94 TRACE_EVENT0("cc", "DelegatingRenderer::DrawFrame"); |
97 | 95 |
98 DCHECK(!delegated_frame_data_); | 96 DCHECK(!delegated_frame_data_); |
99 | 97 |
100 delegated_frame_data_ = make_scoped_ptr(new DelegatedFrameData); | 98 delegated_frame_data_ = make_scoped_ptr(new DelegatedFrameData); |
101 DelegatedFrameData& out_data = *delegated_frame_data_; | 99 DelegatedFrameData& out_data = *delegated_frame_data_; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 gpu::ManagedMemoryStats stats; | 168 gpu::ManagedMemoryStats stats; |
171 stats.bytes_required = bytes_visible; | 169 stats.bytes_required = bytes_visible; |
172 stats.bytes_nice_to_have = bytes_visible_and_nearby; | 170 stats.bytes_nice_to_have = bytes_visible_and_nearby; |
173 stats.bytes_allocated = bytes_allocated; | 171 stats.bytes_allocated = bytes_allocated; |
174 stats.backbuffer_requested = false; | 172 stats.backbuffer_requested = false; |
175 | 173 |
176 context_provider->ContextSupport()->SendManagedMemoryStats(stats); | 174 context_provider->ContextSupport()->SendManagedMemoryStats(stats); |
177 } | 175 } |
178 | 176 |
179 } // namespace cc | 177 } // namespace cc |
OLD | NEW |