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

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

Issue 5105006: Resize synchronization for Linux. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: make -j17 all is my friend (fix the test build). Created 10 years, 1 month 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 fbb6ca4aba07ca30e7f7c69a2aa8e4173cb5d2d8..d1207446131728ba551469383ce2c99a893517ed 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -677,6 +677,7 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
virtual gfx::GLContext* GetGLContext() { return context_.get(); }
virtual ContextGroup* GetContextGroup() { return group_.get(); }
+ virtual void SetResizeCallback(Callback1<gfx::Size>::Type* callback);
virtual void SetSwapBuffersCallback(Callback0::Type* callback);
virtual bool GetServiceTextureId(uint32 client_texture_id,
uint32* service_texture_id);
@@ -1424,6 +1425,7 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
scoped_ptr<Texture> offscreen_saved_color_texture_;
GLenum offscreen_saved_color_format_;
+ scoped_ptr<Callback1<gfx::Size>::Type> resize_callback_;
scoped_ptr<Callback0::Type> swap_buffers_callback_;
// The last error message set.
@@ -2422,6 +2424,10 @@ bool GLES2DecoderImpl::UpdateOffscreenFrameBufferSize() {
return true;
}
+void GLES2DecoderImpl::SetResizeCallback(Callback1<gfx::Size>::Type* callback) {
+ resize_callback_.reset(callback);
+}
+
void GLES2DecoderImpl::SetSwapBuffersCallback(Callback0::Type* callback) {
swap_buffers_callback_.reset(callback);
}
@@ -2552,8 +2558,14 @@ void GLES2DecoderImpl::DoCopyTextureToParentTextureCHROMIUM(
}
void GLES2DecoderImpl::DoResizeCHROMIUM(GLuint width, GLuint height) {
- gfx::Size size(width, height);
- context_->SetSize(size);
+#if defined(OS_LINUX)
+ // Make sure that we are done drawing to the back buffer before resizing.
+ glFinish();
+#endif
+ if (resize_callback_.get()) {
+ gfx::Size size(width, height);
+ resize_callback_->Run(size);
+ }
}
const char* GLES2DecoderImpl::GetCommandName(unsigned int command_id) const {
« 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