| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/surfaces/display.h" | 5 #include "cc/surfaces/display.h" |
| 6 | 6 |
| 7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
| 8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "cc/debug/benchmark_instrumentation.h" | 9 #include "cc/debug/benchmark_instrumentation.h" |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| 11 #include "cc/output/compositor_frame_ack.h" | 11 #include "cc/output/compositor_frame_ack.h" |
| 12 #include "cc/output/direct_renderer.h" | |
| 13 #include "cc/output/gl_renderer.h" | 12 #include "cc/output/gl_renderer.h" |
| 13 #include "cc/output/native_layer_renderer.h" |
| 14 #include "cc/output/renderer_settings.h" | 14 #include "cc/output/renderer_settings.h" |
| 15 #include "cc/output/software_renderer.h" | 15 #include "cc/output/software_renderer.h" |
| 16 #include "cc/output/texture_mailbox_deleter.h" | 16 #include "cc/output/texture_mailbox_deleter.h" |
| 17 #include "cc/surfaces/display_client.h" | 17 #include "cc/surfaces/display_client.h" |
| 18 #include "cc/surfaces/display_scheduler.h" | 18 #include "cc/surfaces/display_scheduler.h" |
| 19 #include "cc/surfaces/surface.h" | 19 #include "cc/surfaces/surface.h" |
| 20 #include "cc/surfaces/surface_aggregator.h" | 20 #include "cc/surfaces/surface_aggregator.h" |
| 21 #include "cc/surfaces/surface_manager.h" | 21 #include "cc/surfaces/surface_manager.h" |
| 22 #include "gpu/command_buffer/client/gles2_interface.h" | 22 #include "gpu/command_buffer/client/gles2_interface.h" |
| 23 #include "ui/gfx/buffer_types.h" | 23 #include "ui/gfx/buffer_types.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( | 105 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( |
| 106 output_surface_.get(), bitmap_manager_, gpu_memory_buffer_manager_, | 106 output_surface_.get(), bitmap_manager_, gpu_memory_buffer_manager_, |
| 107 nullptr, settings_.highp_threshold_min, | 107 nullptr, settings_.highp_threshold_min, |
| 108 settings_.texture_id_allocation_chunk_size, | 108 settings_.texture_id_allocation_chunk_size, |
| 109 std::vector<unsigned>(static_cast<size_t>(gfx::BufferFormat::LAST) + 1, | 109 std::vector<unsigned>(static_cast<size_t>(gfx::BufferFormat::LAST) + 1, |
| 110 GL_TEXTURE_2D)); | 110 GL_TEXTURE_2D)); |
| 111 if (!resource_provider) | 111 if (!resource_provider) |
| 112 return; | 112 return; |
| 113 | 113 |
| 114 if (output_surface_->context_provider()) { | 114 if (output_surface_->context_provider()) { |
| 115 scoped_ptr<GLRenderer> renderer = GLRenderer::Create( | 115 scoped_ptr<Renderer> renderer = NativeLayerRenderer::Create( |
| 116 this, &settings_, output_surface_.get(), resource_provider.get(), | 116 this, &settings_, output_surface_.get(), resource_provider.get(), |
| 117 texture_mailbox_deleter_.get(), settings_.highp_threshold_min); | 117 texture_mailbox_deleter_.get(), settings_.highp_threshold_min); |
| 118 if (!renderer) | 118 if (!renderer) |
| 119 return; | 119 return; |
| 120 renderer_ = renderer.Pass(); | 120 renderer_ = renderer.Pass(); |
| 121 } else { | 121 } else { |
| 122 scoped_ptr<SoftwareRenderer> renderer = SoftwareRenderer::Create( | 122 scoped_ptr<SoftwareRenderer> renderer = SoftwareRenderer::Create( |
| 123 this, &settings_, output_surface_.get(), resource_provider.get()); | 123 this, &settings_, output_surface_.get(), resource_provider.get()); |
| 124 if (!renderer) | 124 if (!renderer) |
| 125 return; | 125 return; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 | 327 |
| 328 if (surface_id == current_surface_id_) | 328 if (surface_id == current_surface_id_) |
| 329 UpdateRootSurfaceResourcesLocked(); | 329 UpdateRootSurfaceResourcesLocked(); |
| 330 } | 330 } |
| 331 | 331 |
| 332 SurfaceId Display::CurrentSurfaceId() { | 332 SurfaceId Display::CurrentSurfaceId() { |
| 333 return current_surface_id_; | 333 return current_surface_id_; |
| 334 } | 334 } |
| 335 | 335 |
| 336 } // namespace cc | 336 } // namespace cc |
| OLD | NEW |