| 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 23 matching lines...) Expand all Loading... |
| 34 OutputSurface* output_surface, | 34 OutputSurface* output_surface, |
| 35 ResourceProvider* resource_provider) | 35 ResourceProvider* resource_provider) |
| 36 : Renderer(client, settings), | 36 : Renderer(client, settings), |
| 37 output_surface_(output_surface), | 37 output_surface_(output_surface), |
| 38 resource_provider_(resource_provider) { | 38 resource_provider_(resource_provider) { |
| 39 DCHECK(resource_provider_); | 39 DCHECK(resource_provider_); |
| 40 | 40 |
| 41 capabilities_.using_partial_swap = false; | 41 capabilities_.using_partial_swap = false; |
| 42 capabilities_.max_texture_size = resource_provider_->max_texture_size(); | 42 capabilities_.max_texture_size = resource_provider_->max_texture_size(); |
| 43 capabilities_.best_texture_format = resource_provider_->best_texture_format(); | 43 capabilities_.best_texture_format = resource_provider_->best_texture_format(); |
| 44 capabilities_.allow_partial_texture_updates = false; | 44 capabilities_.allow_partial_texture_updates = |
| 45 output_surface->capabilities().can_force_reclaim_resources; |
| 45 | 46 |
| 46 if (!output_surface_->context_provider()) { | 47 if (!output_surface_->context_provider()) { |
| 47 capabilities_.using_shared_memory_resources = true; | 48 capabilities_.using_shared_memory_resources = true; |
| 48 } else { | 49 } else { |
| 49 const ContextProvider::Capabilities& caps = | 50 const ContextProvider::Capabilities& caps = |
| 50 output_surface_->context_provider()->ContextCapabilities(); | 51 output_surface_->context_provider()->ContextCapabilities(); |
| 51 | 52 |
| 52 DCHECK(!caps.gpu.iosurface || caps.gpu.texture_rectangle); | 53 DCHECK(!caps.gpu.iosurface || caps.gpu.texture_rectangle); |
| 53 | 54 |
| 54 capabilities_.using_egl_image = caps.gpu.egl_image_external; | 55 capabilities_.using_egl_image = caps.gpu.egl_image_external; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 122 } |
| 122 } | 123 } |
| 123 // We loop visibility to the GPU process, since that's what manages memory. | 124 // We loop visibility to the GPU process, since that's what manages memory. |
| 124 // That will allow it to feed us with memory allocations that we can act | 125 // That will allow it to feed us with memory allocations that we can act |
| 125 // upon. | 126 // upon. |
| 126 if (context_provider) | 127 if (context_provider) |
| 127 context_provider->ContextSupport()->SetSurfaceVisible(visible()); | 128 context_provider->ContextSupport()->SetSurfaceVisible(visible()); |
| 128 } | 129 } |
| 129 | 130 |
| 130 } // namespace cc | 131 } // namespace cc |
| OLD | NEW |