diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-20 13:40:20 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-22 12:41:23 +0000 |
commit | 7961cea6d1041e3e454dae6a1da660b453efd238 (patch) | |
tree | c0eeb4a9ff9ba32986289c1653d9608e53ccb444 /chromium/gpu/skia_bindings | |
parent | b7034d0803538058e5c9d904ef03cf5eab34f6ef (diff) | |
download | qtwebengine-chromium-7961cea6d1041e3e454dae6a1da660b453efd238.tar.gz |
BASELINE: Update Chromium to 78.0.3904.130
Change-Id: If185e0c0061b3437531c97c9c8c78f239352a68b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/gpu/skia_bindings')
-rw-r--r-- | chromium/gpu/skia_bindings/grcontext_for_gles2_interface.cc | 16 | ||||
-rw-r--r-- | chromium/gpu/skia_bindings/grcontext_for_gles2_interface.h | 8 |
2 files changed, 16 insertions, 8 deletions
diff --git a/chromium/gpu/skia_bindings/grcontext_for_gles2_interface.cc b/chromium/gpu/skia_bindings/grcontext_for_gles2_interface.cc index 9234d8ab829..f3e4c06f334 100644 --- a/chromium/gpu/skia_bindings/grcontext_for_gles2_interface.cc +++ b/chromium/gpu/skia_bindings/grcontext_for_gles2_interface.cc @@ -29,15 +29,12 @@ GrContextForGLES2Interface::GrContextForGLES2Interface( size_t max_resource_cache_bytes, size_t max_glyph_cache_texture_bytes) : context_support_(context_support) { - // The limit of the number of GPU resources we hold in the GrContext's - // GPU cache. - static const int kMaxGaneshResourceCacheCount = 16384; - GrContextOptions options; options.fGlyphCacheTextureMaximumBytes = max_glyph_cache_texture_bytes; options.fAvoidStencilBuffers = capabilities.avoid_stencil_buffers; options.fAllowPathMaskCaching = false; options.fSharpenMipmappedTextures = true; + options.fShaderErrorHandler = this; // TODO(csmartdalton): enable internal multisampling after the related Skia // rolls are in. options.fInternalMultisampleCount = 0; @@ -45,8 +42,7 @@ GrContextForGLES2Interface::GrContextForGLES2Interface( skia_bindings::CreateGLES2InterfaceBindings(gl, context_support)); gr_context_ = GrContext::MakeGL(std::move(interface), options); if (gr_context_) { - gr_context_->setResourceCacheLimits(kMaxGaneshResourceCacheCount, - max_resource_cache_bytes); + gr_context_->setResourceCacheLimit(max_resource_cache_bytes); context_support_->SetGrContext(gr_context_.get()); } } @@ -60,6 +56,14 @@ GrContextForGLES2Interface::~GrContextForGLES2Interface() { } } +void GrContextForGLES2Interface::compileError(const char* shader, + const char* errors) { + LOG(ERROR) << "Skia shader compilation error\n" + << "------------------------\n" + << shader << "\nErrors:\n" + << errors; +} + void GrContextForGLES2Interface::OnLostContext() { if (gr_context_) gr_context_->abandonContext(); diff --git a/chromium/gpu/skia_bindings/grcontext_for_gles2_interface.h b/chromium/gpu/skia_bindings/grcontext_for_gles2_interface.h index 878384246a4..cb1e8b27ac4 100644 --- a/chromium/gpu/skia_bindings/grcontext_for_gles2_interface.h +++ b/chromium/gpu/skia_bindings/grcontext_for_gles2_interface.h @@ -7,6 +7,7 @@ #include "base/macros.h" #include "third_party/skia/include/core/SkRefCnt.h" +#include "third_party/skia/include/gpu/GrContextOptions.h" class GrContext; @@ -23,7 +24,7 @@ namespace skia_bindings { // This class binds an offscreen GrContext to an offscreen context3d. The // context3d is used by the GrContext so must be valid as long as this class // is alive. -class GrContextForGLES2Interface { +class GrContextForGLES2Interface : public GrContextOptions::ShaderErrorHandler { public: explicit GrContextForGLES2Interface(gpu::gles2::GLES2Interface* gl, gpu::ContextSupport* context_support, @@ -31,7 +32,10 @@ class GrContextForGLES2Interface { size_t max_resource_cache_bytes, size_t max_glyph_cache_texture_bytes); - virtual ~GrContextForGLES2Interface(); + ~GrContextForGLES2Interface() override; + + // Handles Skia-reported shader compilation errors. + void compileError(const char* shader, const char* errors) override; GrContext* get(); |