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

Unified Diff: content/renderer/pepper/ppb_graphics_3d_impl.cc

Issue 2107783003: Pass initial size and GPU preference via context attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gyp fix Created 4 years, 6 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 | « content/renderer/pepper/pepper_video_encoder_host.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/ppb_graphics_3d_impl.cc
diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc
index 94207f0387dab520c7f84cf59432fe162f9c207f..5e0b5f326414165d8f3381cd8eafe33ed3ddaa0d 100644
--- a/content/renderer/pepper/ppb_graphics_3d_impl.cc
+++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc
@@ -225,9 +225,9 @@ bool PPB_Graphics3D_Impl::InitRaw(PPB_Graphics3D_API* share_context,
if (!channel)
return false;
- gfx::Size surface_size;
+ gpu::gles2::ContextCreationAttribHelper attrib_helper;
std::vector<int32_t> attribs;
- gl::GpuPreference gpu_preference = gl::PreferDiscreteGpu;
+ attrib_helper.gpu_preference = gl::PreferDiscreteGpu;
// TODO(alokp): Change CommandBufferProxyImpl::Create()
// interface to accept width and height in the attrib_list so that
// we do not need to filter for width and height here.
@@ -236,13 +236,13 @@ bool PPB_Graphics3D_Impl::InitRaw(PPB_Graphics3D_API* share_context,
attr += 2) {
switch (attr[0]) {
case PP_GRAPHICS3DATTRIB_WIDTH:
- surface_size.set_width(attr[1]);
+ attrib_helper.offscreen_framebuffer_size.set_width(attr[1]);
break;
case PP_GRAPHICS3DATTRIB_HEIGHT:
- surface_size.set_height(attr[1]);
+ attrib_helper.offscreen_framebuffer_size.set_height(attr[1]);
break;
case PP_GRAPHICS3DATTRIB_GPU_PREFERENCE:
- gpu_preference =
+ attrib_helper.gpu_preference =
(attr[1] == PP_GRAPHICS3DATTRIB_GPU_PREFERENCE_LOW_POWER)
? gl::PreferIntegratedGpu
: gl::PreferDiscreteGpu;
@@ -258,7 +258,6 @@ bool PPB_Graphics3D_Impl::InitRaw(PPB_Graphics3D_API* share_context,
}
attribs.push_back(PP_GRAPHICS3DATTRIB_NONE);
}
- gpu::gles2::ContextCreationAttribHelper attrib_helper;
if (!attrib_helper.Parse(attribs))
return false;
@@ -270,10 +269,9 @@ bool PPB_Graphics3D_Impl::InitRaw(PPB_Graphics3D_API* share_context,
}
command_buffer_ = gpu::CommandBufferProxyImpl::Create(
- std::move(channel), gpu::kNullSurfaceHandle, surface_size, share_buffer,
- gpu::GPU_STREAM_DEFAULT, gpu::GpuStreamPriority::NORMAL,
- attrib_helper, GURL::EmptyGURL(), gpu_preference,
- base::ThreadTaskRunnerHandle::Get());
+ std::move(channel), gpu::kNullSurfaceHandle, share_buffer,
+ gpu::GPU_STREAM_DEFAULT, gpu::GpuStreamPriority::NORMAL, attrib_helper,
+ GURL::EmptyGURL(), base::ThreadTaskRunnerHandle::Get());
if (!command_buffer_)
return false;
« no previous file with comments | « content/renderer/pepper/pepper_video_encoder_host.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698