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