diff options
author | boliu <boliu@chromium.org> | 2016-01-08 16:07:26 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-09 00:08:42 +0000 |
commit | 0ed4f6567c1b77cea282fac1773dfbaa2ac0c939 (patch) | |
tree | 8599606df511c089ae47b7ab52fd4dafbeb0a750 /cc/output | |
parent | 770a614de349b5ec5dc0c20308ff745e215e1d8c (diff) | |
download | chromium_src-0ed4f6567c1b77cea282fac1773dfbaa2ac0c939.zip chromium_src-0ed4f6567c1b77cea282fac1773dfbaa2ac0c939.tar.gz chromium_src-0ed4f6567c1b77cea282fac1773dfbaa2ac0c939.tar.bz2 |
Implement external stencil for Android WebView
Add an OutputSurface::ApplyExternalStencil method.
Android WebView implements this method on the render thread
and applies the stencil parameters read in functor, through
the command buffer client.
BUG=574570
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1564703005
Cr-Commit-Position: refs/heads/master@{#368468}
Diffstat (limited to 'cc/output')
-rw-r--r-- | cc/output/gl_renderer.cc | 2 | ||||
-rw-r--r-- | cc/output/output_surface.cc | 2 | ||||
-rw-r--r-- | cc/output/output_surface.h | 1 | ||||
-rw-r--r-- | cc/output/renderer_pixeltest.cc | 1 |
4 files changed, 5 insertions, 1 deletions
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc index 0183068..4dc802f 100644 --- a/cc/output/gl_renderer.cc +++ b/cc/output/gl_renderer.cc @@ -2926,8 +2926,8 @@ void GLRenderer::BindFramebufferToOutputSurface(DrawingFrame* frame) { output_surface_->BindFramebuffer(); if (output_surface_->HasExternalStencilTest()) { + output_surface_->ApplyExternalStencil(); SetStencilEnabled(true); - gl_->StencilFunc(GL_EQUAL, 1, 1); } else { SetStencilEnabled(false); } diff --git a/cc/output/output_surface.cc b/cc/output/output_surface.cc index 13e41d3..85372ce 100644 --- a/cc/output/output_surface.cc +++ b/cc/output/output_surface.cc @@ -191,6 +191,8 @@ bool OutputSurface::HasExternalStencilTest() const { return external_stencil_test_enabled_; } +void OutputSurface::ApplyExternalStencil() {} + bool OutputSurface::BindToClient(OutputSurfaceClient* client) { DCHECK(client_thread_checker_.CalledOnValidThread()); DCHECK(client); diff --git a/cc/output/output_surface.h b/cc/output/output_surface.h index f135e50..0b06800 100644 --- a/cc/output/output_surface.h +++ b/cc/output/output_surface.h @@ -92,6 +92,7 @@ class CC_EXPORT OutputSurface : public base::trace_event::MemoryDumpProvider { } virtual bool HasExternalStencilTest() const; + virtual void ApplyExternalStencil(); // Obtain the 3d context or the software device associated with this output // surface. Either of these may return a null pointer, but not both. diff --git a/cc/output/renderer_pixeltest.cc b/cc/output/renderer_pixeltest.cc index 6c5e255..f5afaea 100644 --- a/cc/output/renderer_pixeltest.cc +++ b/cc/output/renderer_pixeltest.cc @@ -1889,6 +1889,7 @@ class ExternalStencilPixelTest : public GLRendererPixelTest { device_viewport_size_.width(), device_viewport_size_.height()); gl->Clear(GL_STENCIL_BUFFER_BIT); + gl->StencilFunc(GL_EQUAL, 1, 1); } }; |