Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 1916923004: Request context sharing via content::ContextProviderCommandBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sharegroup: . Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after
2020 results->orientationAngle = display.RotationAsDegree(); 2020 results->orientationAngle = display.RotationAsDegree();
2021 results->orientationType = 2021 results->orientationType =
2022 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 2022 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
2023 gfx::DeviceDisplayInfo info; 2023 gfx::DeviceDisplayInfo info;
2024 results->depth = info.GetBitsPerPixel(); 2024 results->depth = info.GetBitsPerPixel();
2025 results->depthPerComponent = info.GetBitsPerComponent(); 2025 results->depthPerComponent = info.GetBitsPerComponent();
2026 results->isMonochrome = (results->depthPerComponent == 0); 2026 results->isMonochrome = (results->depthPerComponent == 0);
2027 } 2027 }
2028 2028
2029 } // namespace content 2029 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698