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

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

Issue 11734037: Restore gl scissor state when switching FBO targets on Qualcomm (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only update scissor Created 7 years, 11 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/feature_info.cc ('k') | no next file » | 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 13ccc15fa20d5e86a6be05ec80625c2af21998a8..c31222c49a08cf9f7a8b5b166a1eb7b91f88b963 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -598,6 +598,7 @@ class GLES2DecoderImpl : public GLES2Decoder {
virtual error::ContextLostReason GetContextLostReason() OVERRIDE;
private:
+ friend class ScopedFrameBufferBinder;
friend class ScopedGLErrorSuppressor;
friend class ScopedResolvedFrameBufferBinder;
friend class ScopedTextureUploadTimer;
@@ -624,6 +625,9 @@ class GLES2DecoderImpl : public GLES2Decoder {
bool GenVertexArraysOESHelper(GLsizei n, const GLuint* client_ids);
void DeleteVertexArraysOESHelper(GLsizei n, const GLuint* client_ids);
+ // Workarounds
+ void OnFboChanged() const;
+
// TODO(gman): Cache these pointers?
BufferManager* buffer_manager() {
return group_->buffer_manager();
@@ -1743,6 +1747,7 @@ ScopedFrameBufferBinder::ScopedFrameBufferBinder(GLES2DecoderImpl* decoder,
: decoder_(decoder) {
ScopedGLErrorSuppressor suppressor(decoder_);
glBindFramebufferEXT(GL_FRAMEBUFFER, id);
+ decoder->OnFboChanged();
}
ScopedFrameBufferBinder::~ScopedFrameBufferBinder() {
@@ -2615,6 +2620,7 @@ void GLES2DecoderImpl::DeleteFramebuffersHelper(
GL_READ_FRAMEBUFFER_EXT : GL_FRAMEBUFFER;
glBindFramebufferEXT(target, GetBackbufferServiceId());
}
+ OnFboChanged();
RemoveFramebufferInfo(client_ids[ii]);
}
}
@@ -2771,6 +2777,7 @@ void GLES2DecoderImpl::RestoreCurrentFramebufferBindings() {
state_.bound_draw_framebuffer.get(),
GetBackbufferServiceId());
}
+ OnFboChanged();
}
void GLES2DecoderImpl::RestoreCurrentTexture2DBindings() {
@@ -3588,6 +3595,13 @@ void GLES2DecoderImpl::RestoreState() const {
state_.bound_draw_framebuffer->service_id() :
GetBackbufferServiceId();
glBindFramebufferEXT(GL_FRAMEBUFFER, service_id);
+ OnFboChanged();
+}
+
+void GLES2DecoderImpl::OnFboChanged() const {
+ if (workarounds().restore_scissor_on_fbo_change)
+ glScissor(state_.scissor_x, state_.scissor_y,
+ state_.scissor_width, state_.scissor_height);
}
void GLES2DecoderImpl::DoBindFramebuffer(GLenum target, GLuint client_id) {
@@ -3633,6 +3647,7 @@ void GLES2DecoderImpl::DoBindFramebuffer(GLenum target, GLuint client_id) {
}
glBindFramebufferEXT(target, service_id);
+ OnFboChanged();
}
void GLES2DecoderImpl::DoBindRenderbuffer(GLenum target, GLuint client_id) {
« no previous file with comments | « gpu/command_buffer/service/feature_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698