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

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

Issue 2106103005: Revert of Pass initial size and GPU preference via context attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 5e0b5f326414165d8f3381cd8eafe33ed3ddaa0d..94207f0387dab520c7f84cf59432fe162f9c207f 100644
--- a/content/renderer/pepper/ppb_graphics_3d_impl.cc
+++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc
@@ -225,9 +225,9 @@
if (!channel)
return false;
- gpu::gles2::ContextCreationAttribHelper attrib_helper;
+ gfx::Size surface_size;
std::vector<int32_t> attribs;
- attrib_helper.gpu_preference = gl::PreferDiscreteGpu;
+ gl::GpuPreference 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 @@
attr += 2) {
switch (attr[0]) {
case PP_GRAPHICS3DATTRIB_WIDTH:
- attrib_helper.offscreen_framebuffer_size.set_width(attr[1]);
+ surface_size.set_width(attr[1]);
break;
case PP_GRAPHICS3DATTRIB_HEIGHT:
- attrib_helper.offscreen_framebuffer_size.set_height(attr[1]);
+ surface_size.set_height(attr[1]);
break;
case PP_GRAPHICS3DATTRIB_GPU_PREFERENCE:
- attrib_helper.gpu_preference =
+ gpu_preference =
(attr[1] == PP_GRAPHICS3DATTRIB_GPU_PREFERENCE_LOW_POWER)
? gl::PreferIntegratedGpu
: gl::PreferDiscreteGpu;
@@ -258,6 +258,7 @@
}
attribs.push_back(PP_GRAPHICS3DATTRIB_NONE);
}
+ gpu::gles2::ContextCreationAttribHelper attrib_helper;
if (!attrib_helper.Parse(attribs))
return false;
@@ -269,9 +270,10 @@
}
command_buffer_ = gpu::CommandBufferProxyImpl::Create(
- std::move(channel), gpu::kNullSurfaceHandle, share_buffer,
- gpu::GPU_STREAM_DEFAULT, gpu::GpuStreamPriority::NORMAL, attrib_helper,
- GURL::EmptyGURL(), base::ThreadTaskRunnerHandle::Get());
+ 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());
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