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 |
11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
12 #include "cc/output/compositor_frame_ack.h" | 12 #include "cc/output/compositor_frame_ack.h" |
13 #include "cc/output/context_provider.h" | 13 #include "cc/output/context_provider.h" |
14 #include "cc/quads/draw_quad.h" | 14 #include "cc/quads/draw_quad.h" |
15 #include "cc/quads/render_pass.h" | 15 #include "cc/quads/render_pass.h" |
16 #include "cc/resources/resource_provider.h" | 16 #include "cc/resources/resource_provider.h" |
17 #include "gpu/command_buffer/client/context_support.h" | 17 #include "gpu/command_buffer/client/context_support.h" |
18 #include "gpu/command_buffer/client/gles2_interface.h" | 18 #include "gpu/command_buffer/client/gles2_interface.h" |
19 | 19 |
20 | 20 |
21 namespace cc { | 21 namespace cc { |
22 | 22 |
23 scoped_ptr<DelegatingRenderer> DelegatingRenderer::Create( | 23 scoped_ptr<DelegatingRenderer> DelegatingRenderer::Create( |
24 RendererClient* client, | 24 RendererClient* client, |
25 const LayerTreeSettings* settings, | 25 const RendererSettings* settings, |
26 OutputSurface* output_surface, | 26 OutputSurface* output_surface, |
27 ResourceProvider* resource_provider) { | 27 ResourceProvider* resource_provider) { |
28 return make_scoped_ptr(new DelegatingRenderer( | 28 return make_scoped_ptr(new DelegatingRenderer( |
29 client, settings, output_surface, resource_provider)); | 29 client, settings, output_surface, resource_provider)); |
30 } | 30 } |
31 | 31 |
32 DelegatingRenderer::DelegatingRenderer(RendererClient* client, | 32 DelegatingRenderer::DelegatingRenderer(RendererClient* client, |
33 const LayerTreeSettings* settings, | 33 const RendererSettings* settings, |
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(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } | 121 } |
122 } | 122 } |
123 // We loop visibility to the GPU process, since that's what manages memory. | 123 // 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 | 124 // That will allow it to feed us with memory allocations that we can act |
125 // upon. | 125 // upon. |
126 if (context_provider) | 126 if (context_provider) |
127 context_provider->ContextSupport()->SetSurfaceVisible(visible()); | 127 context_provider->ContextSupport()->SetSurfaceVisible(visible()); |
128 } | 128 } |
129 | 129 |
130 } // namespace cc | 130 } // namespace cc |
OLD | NEW |