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

Unified Diff: android_webview/browser/scoped_app_gl_state_restore.cc

Issue 2480373002: Refactor context creation parameters into a struct. (Closed)
Patch Set: Created 4 years, 1 month 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
Index: android_webview/browser/scoped_app_gl_state_restore.cc
diff --git a/android_webview/browser/scoped_app_gl_state_restore.cc b/android_webview/browser/scoped_app_gl_state_restore.cc
index 42fbb7e9776d8d5509552766887fcb0b9fffe8b0..52cc189b98ace1da6c54393e158de75418b700c4 100644
--- a/android_webview/browser/scoped_app_gl_state_restore.cc
+++ b/android_webview/browser/scoped_app_gl_state_restore.cc
@@ -17,6 +17,12 @@ namespace android_webview {
namespace {
+gl::GLContextAttribs GetAppContextAttribs() {
+ gl::GLContextAttribs attribs;
+ attribs.gpu_preference = gl::PreferDiscreteGpu;
+ return attribs;
+}
+
// "App" context is a bit of a stretch. Basically we use this context while
// saving and restoring the App GL state.
class AppContextSurface {
@@ -25,7 +31,7 @@ class AppContextSurface {
: surface(new gl::GLSurfaceStub),
context(gl::init::CreateGLContext(nullptr,
surface.get(),
- gl::PreferDiscreteGpu)) {}
+ GetAppContextAttribs())) {}
piman 2016/11/07 21:01:01 nit: the default GLContextAttribs would be perfect
Geoff Lang 2016/11/07 21:36:20 Done.
void MakeCurrent() { context->MakeCurrent(surface.get()); }
private:
« no previous file with comments | « no previous file | android_webview/browser/test/fake_window.cc » ('j') | android_webview/browser/test/fake_window.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698