| 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 18 matching lines...) Expand all Loading... |
| 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 LayerTreeSettings* 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 //printf("DelegatingRenderer %p\n", this); |
| 39 DCHECK(resource_provider_); | 40 DCHECK(resource_provider_); |
| 40 | 41 |
| 41 capabilities_.using_partial_swap = false; | 42 capabilities_.using_partial_swap = false; |
| 42 capabilities_.max_texture_size = resource_provider_->max_texture_size(); | 43 capabilities_.max_texture_size = resource_provider_->max_texture_size(); |
| 43 capabilities_.best_texture_format = resource_provider_->best_texture_format(); | 44 capabilities_.best_texture_format = resource_provider_->best_texture_format(); |
| 44 capabilities_.allow_partial_texture_updates = false; | 45 capabilities_.allow_partial_texture_updates = false; |
| 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 { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 69 ResourceProvider::ResourceId id) { | 70 ResourceProvider::ResourceId id) { |
| 70 array->push_back(id); | 71 array->push_back(id); |
| 71 return id; | 72 return id; |
| 72 } | 73 } |
| 73 | 74 |
| 74 void DelegatingRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order, | 75 void DelegatingRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order, |
| 75 float device_scale_factor, | 76 float device_scale_factor, |
| 76 const gfx::Rect& device_viewport_rect, | 77 const gfx::Rect& device_viewport_rect, |
| 77 const gfx::Rect& device_clip_rect, | 78 const gfx::Rect& device_clip_rect, |
| 78 bool disable_picture_quad_image_filtering) { | 79 bool disable_picture_quad_image_filtering) { |
| 80 //printf("DelegatingRenderer::DrawFrame start\n"); |
| 79 TRACE_EVENT0("cc", "DelegatingRenderer::DrawFrame"); | 81 TRACE_EVENT0("cc", "DelegatingRenderer::DrawFrame"); |
| 80 | 82 |
| 81 DCHECK(!delegated_frame_data_); | 83 DCHECK(!delegated_frame_data_); |
| 82 | 84 |
| 83 delegated_frame_data_ = make_scoped_ptr(new DelegatedFrameData); | 85 delegated_frame_data_ = make_scoped_ptr(new DelegatedFrameData); |
| 84 DelegatedFrameData& out_data = *delegated_frame_data_; | 86 DelegatedFrameData& out_data = *delegated_frame_data_; |
| 85 out_data.device_scale_factor = device_scale_factor; | 87 out_data.device_scale_factor = device_scale_factor; |
| 86 // Move the render passes and resources into the |out_frame|. | 88 // Move the render passes and resources into the |out_frame|. |
| 87 out_data.render_pass_list.swap(*render_passes_in_draw_order); | 89 out_data.render_pass_list.swap(*render_passes_in_draw_order); |
| 88 | 90 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 } | 124 } |
| 123 } | 125 } |
| 124 // We loop visibility to the GPU process, since that's what manages memory. | 126 // We loop visibility to the GPU process, since that's what manages memory. |
| 125 // That will allow it to feed us with memory allocations that we can act | 127 // That will allow it to feed us with memory allocations that we can act |
| 126 // upon. | 128 // upon. |
| 127 if (context_provider) | 129 if (context_provider) |
| 128 context_provider->ContextSupport()->SetSurfaceVisible(visible()); | 130 context_provider->ContextSupport()->SetSurfaceVisible(visible()); |
| 129 } | 131 } |
| 130 | 132 |
| 131 } // namespace cc | 133 } // namespace cc |
| OLD | NEW |