OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/browser/renderer_host/image_transport_factory_android.h" | 5 #include "content/browser/renderer_host/image_transport_factory_android.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 9 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
10 #include "content/common/gpu/client/gl_helper.h" | 10 #include "content/common/gpu/client/gl_helper.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 display_info.GetDisplayWidth() * | 72 display_info.GetDisplayWidth() * |
73 kBytesPerPixel; | 73 kBytesPerPixel; |
74 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; | 74 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; |
75 limits.command_buffer_size = 64 * 1024; | 75 limits.command_buffer_size = 64 * 1024; |
76 limits.start_transfer_buffer_size = 64 * 1024; | 76 limits.start_transfer_buffer_size = 64 * 1024; |
77 limits.min_transfer_buffer_size = 64 * 1024; | 77 limits.min_transfer_buffer_size = 64 * 1024; |
78 limits.max_transfer_buffer_size = std::min( | 78 limits.max_transfer_buffer_size = std::min( |
79 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize); | 79 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize); |
80 limits.mapped_memory_reclaim_limit = | 80 limits.mapped_memory_reclaim_limit = |
81 WebGraphicsContext3DCommandBufferImpl::kNoLimit; | 81 WebGraphicsContext3DCommandBufferImpl::kNoLimit; |
| 82 bool use_echo_for_swap_ack = true; |
82 context_.reset( | 83 context_.reset( |
83 new WebGraphicsContext3DCommandBufferImpl(0, // offscreen | 84 new WebGraphicsContext3DCommandBufferImpl(0, // offscreen |
84 url, | 85 url, |
85 gpu_channel_host.get(), | 86 gpu_channel_host.get(), |
86 swap_client, | 87 swap_client, |
| 88 use_echo_for_swap_ack, |
87 attrs, | 89 attrs, |
88 false, | 90 false, |
89 limits)); | 91 limits)); |
90 context_->setContextLostCallback(context_lost_listener_.get()); | 92 context_->setContextLostCallback(context_lost_listener_.get()); |
91 if (context_->makeContextCurrent()) | 93 if (context_->makeContextCurrent()) |
92 context_->pushGroupMarkerEXT( | 94 context_->pushGroupMarkerEXT( |
93 base::StringPrintf("CmdBufferImageTransportFactory-%p", | 95 base::StringPrintf("CmdBufferImageTransportFactory-%p", |
94 context_.get()).c_str()); | 96 context_.get()).c_str()); |
95 } | 97 } |
96 | 98 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 187 |
186 void GLContextLostListener::DidLoseContext() { | 188 void GLContextLostListener::DidLoseContext() { |
187 delete g_factory; | 189 delete g_factory; |
188 g_factory = NULL; | 190 g_factory = NULL; |
189 FOR_EACH_OBSERVER(ImageTransportFactoryAndroidObserver, | 191 FOR_EACH_OBSERVER(ImageTransportFactoryAndroidObserver, |
190 g_factory_observers.Get(), | 192 g_factory_observers.Get(), |
191 OnLostResources()); | 193 OnLostResources()); |
192 } | 194 } |
193 | 195 |
194 } // namespace content | 196 } // namespace content |
OLD | NEW |