gpu: Support other buffer targets for ScopedBufferBinder
As a result of [1], ScopedBufferBinder supports decoder state restoration only for GL_ARRAY_BUFFER.
This CL now extends its support for other buffer targets which are supported at the context level.
[1] https://codereview.chromium.org/2762833003/
BUG=None
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Review-Url: https://codereview.chromium.org/2788793003
Cr-Commit-Position: refs/heads/master@{#462376}
diff --git a/gpu/command_buffer/service/context_state.h b/gpu/command_buffer/service/context_state.h
index 050fc0c..056dd4f6 100644
--- a/gpu/command_buffer/service/context_state.h
+++ b/gpu/command_buffer/service/context_state.h
@@ -217,7 +217,6 @@
void RestoreVertexAttribArrays(
const scoped_refptr<VertexAttribManager> attrib_manager) const;
void RestoreVertexAttribs() const;
- void RestoreBufferBinding(unsigned int target) const;
void RestoreBufferBindings() const;
void RestoreGlobalState(const ContextState* prev_state) const;
void RestoreProgramSettings(const ContextState* prev_state,
@@ -310,6 +309,13 @@
PixelStoreParams GetPackParams();
PixelStoreParams GetUnpackParams(Dimension dimension);
+ // If a buffer object is bound to PIXEL_PACK_BUFFER, set all pack parameters
+ // user values; otherwise, set them to 0.
+ void UpdatePackParameters() const;
+ // If a buffer object is bound to PIXEL_UNPACK_BUFFER, set all unpack
+ // parameters user values; otherwise, set them to 0.
+ void UpdateUnpackParameters() const;
+
void EnableDisableFramebufferSRGB(bool enable);
#include "gpu/command_buffer/service/context_state_autogen.h"
@@ -370,13 +376,6 @@
private:
void EnableDisable(GLenum pname, bool enable) const;
- // If a buffer object is bound to PIXEL_PACK_BUFFER, set all pack parameters
- // user values; otherwise, set them to 0.
- void UpdatePackParameters() const;
- // If a buffer object is bound to PIXEL_UNPACK_BUFFER, set all unpack
- // parameters user values; otherwise, set them to 0.
- void UpdateUnpackParameters() const;
-
void InitStateManual(const ContextState* prev_state) const;
// EnableDisableFramebufferSRGB is called at very high frequency. Cache the