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/render_widget_host_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
6 | 6 |
7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 limits.command_buffer_size = 1024; | 176 limits.command_buffer_size = 1024; |
177 // The transfer buffer is used for shaders among other things, so give some | 177 // The transfer buffer is used for shaders among other things, so give some |
178 // reasonable but small limit. | 178 // reasonable but small limit. |
179 limits.start_transfer_buffer_size = 4 * 1024; | 179 limits.start_transfer_buffer_size = 4 * 1024; |
180 limits.min_transfer_buffer_size = 4 * 1024; | 180 limits.min_transfer_buffer_size = 4 * 1024; |
181 limits.max_transfer_buffer_size = full_screen_texture_size_in_bytes; | 181 limits.max_transfer_buffer_size = full_screen_texture_size_in_bytes; |
182 // This context is used for doing async readbacks, so allow at least a full | 182 // This context is used for doing async readbacks, so allow at least a full |
183 // screen readback to be mapped. | 183 // screen readback to be mapped. |
184 limits.mapped_memory_reclaim_limit = full_screen_texture_size_in_bytes; | 184 limits.mapped_memory_reclaim_limit = full_screen_texture_size_in_bytes; |
185 | 185 |
186 bool share_resources = false; | |
187 bool automatic_flushes = false; | 186 bool automatic_flushes = false; |
188 GURL url("chrome://gpu/RenderWidgetHostViewAndroid"); | 187 GURL url("chrome://gpu/RenderWidgetHostViewAndroid"); |
189 | 188 |
190 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context( | 189 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context( |
191 new WebGraphicsContext3DCommandBufferImpl( | 190 new WebGraphicsContext3DCommandBufferImpl( |
192 gpu::kNullSurfaceHandle, // offscreen | 191 gpu::kNullSurfaceHandle, // offscreen |
193 url, gpu_channel_host.get(), attributes, gfx::PreferIntegratedGpu, | 192 url, gpu_channel_host.get(), attributes, gfx::PreferIntegratedGpu, |
194 share_resources, automatic_flushes, nullptr)); | 193 automatic_flushes)); |
195 provider_ = new ContextProviderCommandBuffer( | 194 provider_ = |
196 std::move(context), limits, BROWSER_OFFSCREEN_MAINTHREAD_CONTEXT); | 195 new ContextProviderCommandBuffer(std::move(context), limits, nullptr, |
| 196 BROWSER_OFFSCREEN_MAINTHREAD_CONTEXT); |
197 if (!provider_->BindToCurrentThread()) | 197 if (!provider_->BindToCurrentThread()) |
198 return; | 198 return; |
199 provider_->ContextGL()->TraceBeginCHROMIUM( | 199 provider_->ContextGL()->TraceBeginCHROMIUM( |
200 "gpu_toplevel", | 200 "gpu_toplevel", |
201 base::StringPrintf("CmdBufferImageTransportFactory-%p", provider_.get()) | 201 base::StringPrintf("CmdBufferImageTransportFactory-%p", provider_.get()) |
202 .c_str()); | 202 .c_str()); |
203 provider_->SetLostContextCallback( | 203 provider_->SetLostContextCallback( |
204 base::Bind(&GLHelperHolder::OnContextLost, base::Unretained(this))); | 204 base::Bind(&GLHelperHolder::OnContextLost, base::Unretained(this))); |
205 gl_helper_.reset(new display_compositor::GLHelper( | 205 gl_helper_.reset(new display_compositor::GLHelper( |
206 provider_->ContextGL(), provider_->ContextSupport())); | 206 provider_->ContextGL(), provider_->ContextSupport())); |
(...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2018 results->orientationAngle = display.RotationAsDegree(); | 2018 results->orientationAngle = display.RotationAsDegree(); |
2019 results->orientationType = | 2019 results->orientationType = |
2020 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 2020 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
2021 gfx::DeviceDisplayInfo info; | 2021 gfx::DeviceDisplayInfo info; |
2022 results->depth = info.GetBitsPerPixel(); | 2022 results->depth = info.GetBitsPerPixel(); |
2023 results->depthPerComponent = info.GetBitsPerComponent(); | 2023 results->depthPerComponent = info.GetBitsPerComponent(); |
2024 results->isMonochrome = (results->depthPerComponent == 0); | 2024 results->isMonochrome = (results->depthPerComponent == 0); |
2025 } | 2025 } |
2026 | 2026 |
2027 } // namespace content | 2027 } // namespace content |
OLD | NEW |