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

Unified Diff: content/browser/android/in_process/synchronous_compositor_factory_impl.cc

Issue 1064033002: android: Merge WrapContext and WrapContextWithAttributes into a single function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/in_process/synchronous_compositor_factory_impl.cc
diff --git a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
index 3f0e41fd4bc85aef40a0ea3acbc9a5157b9c6254..470743a547ca066e1f434035ec6e4df9038b3b64 100644
--- a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
+++ b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
@@ -67,17 +67,6 @@ scoped_ptr<gpu::GLInProcessContext> CreateContextHolder(
}
scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> WrapContext(
- scoped_ptr<gpu::GLInProcessContext> context) {
- if (!context.get())
- return scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>();
-
- return scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>(
- WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext(
- context.Pass(), GetDefaultAttribs()));
-}
-
-scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>
-WrapContextWithAttributes(
scoped_ptr<gpu::GLInProcessContext> context,
const blink::WebGraphicsContext3D::Attributes& attributes) {
if (!context.get())
@@ -96,9 +85,8 @@ class SynchronousCompositorFactoryImpl::VideoContextProvider
VideoContextProvider(
scoped_ptr<gpu::GLInProcessContext> gl_in_process_context)
: gl_in_process_context_(gl_in_process_context.get()) {
-
context_provider_ = webkit::gpu::ContextProviderInProcess::Create(
- WrapContext(gl_in_process_context.Pass()),
+ WrapContext(gl_in_process_context.Pass(), GetDefaultAttribs()),
"Video-Offscreen-main-thread");
context_provider_->BindToCurrentThread();
}
@@ -185,20 +173,21 @@ SynchronousCompositorFactoryImpl::CreateOffscreenContextProvider(
scoped_ptr<gpu::GLInProcessContext> context = CreateContextHolder(
attributes, nullptr, gpu::GLInProcessContextSharedMemoryLimits(), true);
return webkit::gpu::ContextProviderInProcess::Create(
- WrapContext(context.Pass()), debug_name);
+ WrapContext(context.Pass(), attributes), debug_name);
}
scoped_refptr<cc::ContextProvider>
SynchronousCompositorFactoryImpl::CreateContextProviderForCompositor() {
DCHECK(service_.get());
+ blink::WebGraphicsContext3D::Attributes attributes = GetDefaultAttribs();
gpu::GLInProcessContextSharedMemoryLimits mem_limits;
// This is half of what RenderWidget uses because synchronous compositor
// pipeline is only one frame deep.
mem_limits.mapped_memory_reclaim_limit = 6 * 1024 * 1024;
return webkit::gpu::ContextProviderInProcess::Create(
- WrapContext(
- CreateContextHolder(GetDefaultAttribs(), nullptr, mem_limits, true)),
+ WrapContext(CreateContextHolder(attributes, nullptr, mem_limits, true),
+ attributes),
"Child-Compositor");
}
@@ -216,11 +205,10 @@ SynchronousCompositorFactoryImpl::CreateStreamTextureFactory(int frame_id) {
WebGraphicsContext3DInProcessCommandBufferImpl*
SynchronousCompositorFactoryImpl::CreateOffscreenGraphicsContext3D(
const blink::WebGraphicsContext3D::Attributes& attributes) {
- return WrapContextWithAttributes(
- CreateContextHolder(attributes, nullptr,
- gpu::GLInProcessContextSharedMemoryLimits(),
- true),
- attributes).release();
+ return WrapContext(CreateContextHolder(
+ attributes, nullptr,
+ gpu::GLInProcessContextSharedMemoryLimits(), true),
+ attributes).release();
}
void SynchronousCompositorFactoryImpl::CompositorInitializedHardwareDraw() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698