Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2788793003: gpu: Support other buffer targets for ScopedBufferBinder (Closed)
Patch Set: Update{Pack,Unpack}Parameters() made public Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_mock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 496068d0bc88846a638199415e4c4ef24c495176..cc1c913d33f31582bfab1e5619fb5003ac541952 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -547,9 +547,6 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
void RestoreActiveTextureUnitBinding(unsigned int target) const override {
state_.RestoreActiveTextureUnitBinding(target);
}
- void RestoreBufferBinding(unsigned int target) const override {
- state_.RestoreBufferBinding(target);
- }
void RestoreBufferBindings() const override {
state_.RestoreBufferBindings();
}
@@ -563,6 +560,7 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
void RestoreVertexAttribArray(unsigned index) override {
RestoreStateForAttrib(index, true);
}
+ void RestoreBufferBinding(unsigned int target) override;
void RestoreFramebufferBindings() const override;
void RestoreRenderbufferBindings() override;
void RestoreTextureState(unsigned service_id) const override;
@@ -5600,6 +5598,17 @@ void GLES2DecoderImpl::RestoreState(const ContextState* prev_state) {
state_.RestoreState(prev_state);
}
+void GLES2DecoderImpl::RestoreBufferBinding(unsigned int target) {
+ if (target == GL_PIXEL_PACK_BUFFER) {
+ state_.UpdatePackParameters();
+ } else if (target == GL_PIXEL_UNPACK_BUFFER) {
+ state_.UpdateUnpackParameters();
+ }
+ Buffer* bound_buffer =
+ buffer_manager()->GetBufferInfoForTarget(&state_, target);
+ glBindBuffer(target, bound_buffer ? bound_buffer->service_id() : 0);
+}
+
void GLES2DecoderImpl::RestoreFramebufferBindings() const {
GLuint service_id =
framebuffer_state_.bound_draw_framebuffer.get()
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698