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 30 matching lines...) Expand all Loading... |
41 | 41 |
42 capabilities_.using_partial_swap = false; | 42 capabilities_.using_partial_swap = false; |
43 capabilities_.max_texture_size = resource_provider_->max_texture_size(); | 43 capabilities_.max_texture_size = resource_provider_->max_texture_size(); |
44 capabilities_.best_texture_format = resource_provider_->best_texture_format(); | 44 capabilities_.best_texture_format = resource_provider_->best_texture_format(); |
45 capabilities_.allow_partial_texture_updates = | 45 capabilities_.allow_partial_texture_updates = |
46 output_surface->capabilities().can_force_reclaim_resources; | 46 output_surface->capabilities().can_force_reclaim_resources; |
47 | 47 |
48 if (!output_surface_->context_provider()) { | 48 if (!output_surface_->context_provider()) { |
49 capabilities_.using_shared_memory_resources = true; | 49 capabilities_.using_shared_memory_resources = true; |
50 } else { | 50 } else { |
51 const ContextProvider::Capabilities& caps = | 51 const auto& caps = |
52 output_surface_->context_provider()->ContextCapabilities(); | 52 output_surface_->context_provider()->ContextCapabilities(); |
53 | 53 |
54 DCHECK(!caps.gpu.iosurface || caps.gpu.texture_rectangle); | 54 DCHECK(!caps.iosurface || caps.texture_rectangle); |
55 | 55 |
56 capabilities_.using_egl_image = caps.gpu.egl_image_external; | 56 capabilities_.using_egl_image = caps.egl_image_external; |
57 capabilities_.using_image = caps.gpu.image; | 57 capabilities_.using_image = caps.image; |
58 | 58 |
59 capabilities_.allow_rasterize_on_demand = false; | 59 capabilities_.allow_rasterize_on_demand = false; |
60 | 60 |
61 // If MSAA is slow, we want this renderer to behave as though MSAA is not | 61 // If MSAA is slow, we want this renderer to behave as though MSAA is not |
62 // available. Set samples to 0 to achieve this. | 62 // available. Set samples to 0 to achieve this. |
63 if (caps.gpu.msaa_is_slow) | 63 if (caps.msaa_is_slow) |
64 capabilities_.max_msaa_samples = 0; | 64 capabilities_.max_msaa_samples = 0; |
65 else | 65 else |
66 capabilities_.max_msaa_samples = caps.gpu.max_samples; | 66 capabilities_.max_msaa_samples = caps.max_samples; |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 DelegatingRenderer::~DelegatingRenderer() {} | 70 DelegatingRenderer::~DelegatingRenderer() {} |
71 | 71 |
72 const RendererCapabilitiesImpl& DelegatingRenderer::Capabilities() const { | 72 const RendererCapabilitiesImpl& DelegatingRenderer::Capabilities() const { |
73 return capabilities_; | 73 return capabilities_; |
74 } | 74 } |
75 | 75 |
76 void DelegatingRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order, | 76 void DelegatingRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 122 } |
123 } | 123 } |
124 if (context_provider) { | 124 if (context_provider) { |
125 // If we are not visible, we ask the context to aggressively free resources. | 125 // If we are not visible, we ask the context to aggressively free resources. |
126 context_provider->ContextSupport()->SetAggressivelyFreeResources( | 126 context_provider->ContextSupport()->SetAggressivelyFreeResources( |
127 !visible()); | 127 !visible()); |
128 } | 128 } |
129 } | 129 } |
130 | 130 |
131 } // namespace cc | 131 } // namespace cc |
OLD | NEW |