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

Unified Diff: webkit/common/gpu/webgraphicscontext3d_impl.cc

Issue 455783002: GPU context creation code duplication cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 6 years, 4 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
Index: webkit/common/gpu/webgraphicscontext3d_impl.cc
diff --git a/webkit/common/gpu/webgraphicscontext3d_impl.cc b/webkit/common/gpu/webgraphicscontext3d_impl.cc
index 86df14a797384b2e3dfe7a369dd61767ebd7438d..7fdb73b0f2954d21108a63935ec41e7bd7240735 100644
--- a/webkit/common/gpu/webgraphicscontext3d_impl.cc
+++ b/webkit/common/gpu/webgraphicscontext3d_impl.cc
@@ -10,6 +10,7 @@
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/gles2_lib.h"
+#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h"
#include "third_party/khronos/GLES2/gl2.h"
@@ -980,5 +981,18 @@ void WebGraphicsContext3DImpl::copyTextureToParentTextureCHROMIUM(
void WebGraphicsContext3DImpl::releaseShaderCompiler() {
}
+// static
+void WebGraphicsContext3DImpl::ConvertAttributes(
+ const blink::WebGraphicsContext3D::Attributes& attributes,
+ ::gpu::gles2::ContextCreationAttribHelper* output_attribs) {
+ output_attribs->alpha_size_ = attributes.alpha ? 8 : 0;
+ output_attribs->depth_size_ = attributes.depth ? 24 : 0;
+ output_attribs->stencil_size_ = attributes.stencil ? 8 : 0;
+ output_attribs->samples_ = attributes.antialias ? 4 : 0;
+ output_attribs->sample_buffers_ = attributes.antialias ? 1 : 0;
+ output_attribs->fail_if_major_perf_caveat_ =
+ attributes.failIfMajorPerformanceCaveat ? 1 : 0;
+}
+
} // namespace gpu
} // namespace webkit

Powered by Google App Engine
This is Rietveld 408576698