aw_gl_surface_external_stencil.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ANDROID_WEBVIEW_BROWSER_GFX_AW_GL_SURFACE_EXTERNAL_STENCIL_H_
  5. #define ANDROID_WEBVIEW_BROWSER_GFX_AW_GL_SURFACE_EXTERNAL_STENCIL_H_
  6. #include "android_webview/browser/gfx/aw_gl_surface.h"
  7. namespace android_webview {
  8. class AwGLSurfaceExternalStencil : public AwGLSurface {
  9. public:
  10. AwGLSurfaceExternalStencil(gl::GLDisplayEGL* display, bool is_angle);
  11. AwGLSurfaceExternalStencil(const AwGLSurfaceExternalStencil&) = delete;
  12. AwGLSurfaceExternalStencil& operator=(const AwGLSurfaceExternalStencil&) =
  13. delete;
  14. unsigned int GetBackingFramebufferObject() override;
  15. gfx::SwapResult SwapBuffers(PresentationCallback callback) override;
  16. void RecalculateClipAndTransform(gfx::Size* viewport,
  17. gfx::Rect* clip_rect,
  18. gfx::Transform* transform) override;
  19. bool IsDrawingToFBO() override;
  20. protected:
  21. ~AwGLSurfaceExternalStencil() override;
  22. private:
  23. class BlitContext;
  24. class FrameBuffer;
  25. // Contains GL shader and other info required to draw a quad.
  26. std::unique_ptr<BlitContext> blit_context_;
  27. std::unique_ptr<FrameBuffer> framebuffer_;
  28. gfx::Rect clip_rect_;
  29. gfx::Size viewport_;
  30. };
  31. } // namespace android_webview
  32. #endif // ANDROID_WEBVIEW_BROWSER_GFX_AW_GL_SURFACE_EXTERNAL_STENCIL_H_