| 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 "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 limits.max_transfer_buffer_size = std::min( | 204 limits.max_transfer_buffer_size = std::min( |
| 205 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize); | 205 3 * full_screen_texture_size_in_bytes, kDefaultMaxTransferBufferSize); |
| 206 limits.mapped_memory_reclaim_limit = | 206 limits.mapped_memory_reclaim_limit = |
| 207 WebGraphicsContext3DCommandBufferImpl::kNoLimit; | 207 WebGraphicsContext3DCommandBufferImpl::kNoLimit; |
| 208 bool lose_context_when_out_of_memory = false; | 208 bool lose_context_when_out_of_memory = false; |
| 209 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( | 209 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( |
| 210 new WebGraphicsContext3DCommandBufferImpl( | 210 new WebGraphicsContext3DCommandBufferImpl( |
| 211 0, // offscreen | 211 0, // offscreen |
| 212 url, gpu_channel_host.get(), attrs, lose_context_when_out_of_memory, | 212 url, gpu_channel_host.get(), attrs, lose_context_when_out_of_memory, |
| 213 limits, nullptr)); | 213 limits, nullptr)); |
| 214 context->SetContextType(BROWSER_OFFSCREEN_MAINTHREAD_CONTEXT); |
| 214 if (context->InitializeOnCurrentThread()) { | 215 if (context->InitializeOnCurrentThread()) { |
| 215 context->traceBeginCHROMIUM( | 216 context->traceBeginCHROMIUM( |
| 216 "gpu_toplevel", | 217 "gpu_toplevel", |
| 217 base::StringPrintf("CmdBufferImageTransportFactory-%p", | 218 base::StringPrintf("CmdBufferImageTransportFactory-%p", |
| 218 context.get()).c_str()); | 219 context.get()).c_str()); |
| 219 } else { | 220 } else { |
| 220 context.reset(); | 221 context.reset(); |
| 221 } | 222 } |
| 222 | 223 |
| 223 return context.Pass(); | 224 return context.Pass(); |
| (...skipping 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2036 results->orientationAngle = display.RotationAsDegree(); | 2037 results->orientationAngle = display.RotationAsDegree(); |
| 2037 results->orientationType = | 2038 results->orientationType = |
| 2038 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 2039 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 2039 gfx::DeviceDisplayInfo info; | 2040 gfx::DeviceDisplayInfo info; |
| 2040 results->depth = info.GetBitsPerPixel(); | 2041 results->depth = info.GetBitsPerPixel(); |
| 2041 results->depthPerComponent = info.GetBitsPerComponent(); | 2042 results->depthPerComponent = info.GetBitsPerComponent(); |
| 2042 results->isMonochrome = (results->depthPerComponent == 0); | 2043 results->isMonochrome = (results->depthPerComponent == 0); |
| 2043 } | 2044 } |
| 2044 | 2045 |
| 2045 } // namespace content | 2046 } // namespace content |
| OLD | NEW |