// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include #include "base/macros.h" #include "base/memory/scoped_ptr.h" namespace gfx { class GLContext; } namespace android_webview { namespace internal { class ScopedAppGLStateRestoreImpl; } struct StencilState { unsigned char stencil_test_enabled; int stencil_front_func; int stencil_front_ref; int stencil_front_mask; int stencil_back_func; int stencil_back_ref; int stencil_back_mask; int stencil_clear; int stencil_front_writemask; int stencil_back_writemask; int stencil_front_fail_op; int stencil_front_z_fail_op; int stencil_front_z_pass_op; int stencil_back_fail_op; int stencil_back_z_fail_op; int stencil_back_z_pass_op; }; // This class is not thread safe and should only be used on the UI thread. class ScopedAppGLStateRestore { public: enum CallMode { MODE_DRAW, MODE_RESOURCE_MANAGEMENT, }; explicit ScopedAppGLStateRestore(CallMode mode); ~ScopedAppGLStateRestore(); StencilState stencil_state() const; int framebuffer_binding_ext() const; private: scoped_ptr impl_; DISALLOW_COPY_AND_ASSIGN(ScopedAppGLStateRestore); }; } // namespace android_webview