Commit 275abb89 authored by kylechar's avatar kylechar Committed by Commit Bot

Set stencil_bits to 0 for SkiaRenderer

In SkiaOutputDeviceGL we are creating a GrBackendRenderTarget and saying
we have created a stencil buffer for it. From what I can tell, we
haven't actually created the stencil buffer anywhere. In theory this
should have no memory impact since Skia just thinks there is a stencil
buffer but doesn't allocate it. Skia should only allocate a small C++
object to track the stencil buffer memory it thinks was allocated.

However, pinpoint found a statistically significant memory difference
with this change on some stories. This CL fixes skia category memory
tracing to be more accurate as well.

Bug: 1055190
Change-Id: Ic9a195f3fd68b8c58a65863018307c1b2d7da8b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2112148
Commit-Queue: kylechar <kylechar@chromium.org>
Reviewed-by: default avatarVasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753307}
parent 7ebdda48
......@@ -146,8 +146,9 @@ bool SkiaOutputDeviceGL::Reshape(const gfx::Size& size,
// used with Windows updated RS3 (2017) as a workaround for a DWM bug so it
// might not be relevant to support anymore as a result.
GrBackendRenderTarget render_target(size.width(), size.height(), 0, 8,
framebuffer_info);
GrBackendRenderTarget render_target(size.width(), size.height(),
/*sampleCnt=*/0,
/*stencilBits=*/0, framebuffer_info);
auto origin = (gl_surface_->GetOrigin() == gfx::SurfaceOrigin::kTopLeft)
? kTopLeft_GrSurfaceOrigin
: kBottomLeft_GrSurfaceOrigin;
......
......@@ -112,8 +112,9 @@ void SkiaOutputDeviceWebView::InitSkiaSurface(unsigned int fbo) {
supports_alpha_ ? GrGLFormat::kRGBA8 : GrGLFormat::kRGB8);
SkColorType color_type = capabilities_.sk_color_type;
GrBackendRenderTarget render_target(size_.width(), size_.height(), 0, 8,
framebuffer_info);
GrBackendRenderTarget render_target(size_.width(), size_.height(),
/*sampleCnt=*/0,
/*stencilBits=*/0, framebuffer_info);
auto origin = (gl_surface_->GetOrigin() == gfx::SurfaceOrigin::kTopLeft)
? kTopLeft_GrSurfaceOrigin
: kBottomLeft_GrSurfaceOrigin;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment