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

Unified Diff: gpu/skia_bindings/grcontext_for_gles2_interface.cc

Issue 2891563002: Add workaround for Mac stencil buffer leak (Closed)
Patch Set: Created 3 years, 7 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: gpu/skia_bindings/grcontext_for_gles2_interface.cc
diff --git a/gpu/skia_bindings/grcontext_for_gles2_interface.cc b/gpu/skia_bindings/grcontext_for_gles2_interface.cc
index ee7516b4db403403b85c3924433c774ad5cd5c8f..fd58f162a803234382b86e3be08ef69e4f779df6 100644
--- a/gpu/skia_bindings/grcontext_for_gles2_interface.cc
+++ b/gpu/skia_bindings/grcontext_for_gles2_interface.cc
@@ -13,6 +13,7 @@
#include "base/sys_info.h"
#include "base/trace_event/trace_event.h"
#include "gpu/command_buffer/client/gles2_interface.h"
+#include "gpu/command_buffer/common/capabilities.h"
#include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h"
#include "third_party/skia/include/gpu/GrContext.h"
#include "third_party/skia/include/gpu/gl/GrGLInterface.h"
@@ -20,13 +21,16 @@
namespace skia_bindings {
GrContextForGLES2Interface::GrContextForGLES2Interface(
- gpu::gles2::GLES2Interface* gl) {
+ gpu::gles2::GLES2Interface* gl,
+ const gpu::Capabilities& capabilities) {
+ GrContextOptions options;
+ options.fAvoidStencilBuffers = capabilities.avoid_stencil_buffers;
sk_sp<GrGLInterface> interface(
skia_bindings::CreateGLES2InterfaceBindings(gl));
- gr_context_ = sk_sp<GrContext>(
- GrContext::Create(kOpenGL_GrBackend,
- // GrContext takes ownership of |interface|.
- reinterpret_cast<GrBackendContext>(interface.get())));
+ gr_context_ = sk_sp<GrContext>(GrContext::Create(
+ kOpenGL_GrBackend,
+ // GrContext takes ownership of |interface|.
+ reinterpret_cast<GrBackendContext>(interface.get()), options));
if (gr_context_) {
// The limit of the number of GPU resources we hold in the GrContext's
// GPU cache.
« no previous file with comments | « gpu/skia_bindings/grcontext_for_gles2_interface.h ('k') | services/ui/public/cpp/gpu/context_provider_command_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698