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" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 95 } |
96 | 96 |
97 void Display::SetExternalClip(const gfx::Rect& clip) { | 97 void Display::SetExternalClip(const gfx::Rect& clip) { |
98 external_clip_ = clip; | 98 external_clip_ = clip; |
99 } | 99 } |
100 | 100 |
101 void Display::InitializeRenderer() { | 101 void Display::InitializeRenderer() { |
102 if (resource_provider_) | 102 if (resource_provider_) |
103 return; | 103 return; |
104 | 104 |
| 105 // Display does not use GpuMemoryBuffers, so persistent map is not relevant. |
| 106 bool use_persistent_map_for_gpu_memory_buffers = false; |
105 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( | 107 scoped_ptr<ResourceProvider> resource_provider = ResourceProvider::Create( |
106 output_surface_.get(), bitmap_manager_, gpu_memory_buffer_manager_, | 108 output_surface_.get(), bitmap_manager_, gpu_memory_buffer_manager_, |
107 nullptr, settings_.highp_threshold_min, settings_.use_rgba_4444_textures, | 109 nullptr, settings_.highp_threshold_min, settings_.use_rgba_4444_textures, |
108 settings_.texture_id_allocation_chunk_size, | 110 settings_.texture_id_allocation_chunk_size, |
| 111 use_persistent_map_for_gpu_memory_buffers, |
109 std::vector<unsigned>(static_cast<size_t>(gfx::BufferFormat::LAST) + 1, | 112 std::vector<unsigned>(static_cast<size_t>(gfx::BufferFormat::LAST) + 1, |
110 GL_TEXTURE_2D)); | 113 GL_TEXTURE_2D)); |
111 if (!resource_provider) | 114 if (!resource_provider) |
112 return; | 115 return; |
113 | 116 |
114 if (output_surface_->context_provider()) { | 117 if (output_surface_->context_provider()) { |
115 scoped_ptr<GLRenderer> renderer = GLRenderer::Create( | 118 scoped_ptr<GLRenderer> renderer = GLRenderer::Create( |
116 this, &settings_, output_surface_.get(), resource_provider.get(), | 119 this, &settings_, output_surface_.get(), resource_provider.get(), |
117 texture_mailbox_deleter_.get(), settings_.highp_threshold_min); | 120 texture_mailbox_deleter_.get(), settings_.highp_threshold_min); |
118 if (!renderer) | 121 if (!renderer) |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 328 |
326 if (surface_id == current_surface_id_) | 329 if (surface_id == current_surface_id_) |
327 UpdateRootSurfaceResourcesLocked(); | 330 UpdateRootSurfaceResourcesLocked(); |
328 } | 331 } |
329 | 332 |
330 SurfaceId Display::CurrentSurfaceId() { | 333 SurfaceId Display::CurrentSurfaceId() { |
331 return current_surface_id_; | 334 return current_surface_id_; |
332 } | 335 } |
333 | 336 |
334 } // namespace cc | 337 } // namespace cc |
OLD | NEW |