summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-02 23:25:45 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-02 23:25:45 +0000
commitc71caa87c8fa6d6438bbe9ec9578874f0044845b (patch)
treeee524e85fde89a958de4790487f4f42c4470cf42 /gpu
parentef52649269185150c31448daae61efdee312d270 (diff)
downloadchromium_src-c71caa87c8fa6d6438bbe9ec9578874f0044845b.zip
chromium_src-c71caa87c8fa6d6438bbe9ec9578874f0044845b.tar.gz
chromium_src-c71caa87c8fa6d6438bbe9ec9578874f0044845b.tar.bz2
Expose UpdateOffscreenFrameBufferSize from GLES2Decoder to allow Mac
port to call it during resizing. Because the Mac port does all of its rendering offscreen, the back buffer must be resized immediately rather than waiting until the next SwapBuffers call. Tested with npapi_pepper_test_plugin and GPU unit tests. BUG=45246 TEST=none Review URL: http://codereview.chromium.org/2466003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48789 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc3
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.h5
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_mock.h1
-rw-r--r--gpu/command_buffer/service/gpu_processor_mac.cc2
4 files changed, 9 insertions, 2 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index c081fa2..588be6e 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -532,6 +532,7 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
uint32 parent_client_texture_id);
virtual void Destroy();
virtual void ResizeOffscreenFrameBuffer(const gfx::Size& size);
+ virtual bool UpdateOffscreenFrameBufferSize();
virtual bool MakeCurrent();
virtual GLES2Util* GetGLES2Util() { return &util_; }
virtual gfx::GLContext* GetGLContext() { return context_; }
@@ -597,8 +598,6 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
return group_->texture_manager();
}
- bool UpdateOffscreenFrameBufferSize();
-
// Creates a TextureInfo for the given texture.
TextureManager::TextureInfo* CreateTextureInfo(
GLuint client_id, GLuint service_id) {
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.h b/gpu/command_buffer/service/gles2_cmd_decoder.h
index e0829cf..6177a32 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.h
@@ -64,6 +64,11 @@ class GLES2Decoder : public CommonDecoder {
// Resize an offscreen frame buffer.
virtual void ResizeOffscreenFrameBuffer(const gfx::Size& size) = 0;
+ // Force the offscreen frame buffer's size to be updated. This
+ // usually occurs lazily, during SwapBuffers, but on some platforms
+ // (Mac OS X in particular) it must be done immediately.
+ virtual bool UpdateOffscreenFrameBufferSize() = 0;
+
// Make this decoder's GL context current.
virtual bool MakeCurrent() = 0;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
index d69d755..3db3ddc 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
@@ -34,6 +34,7 @@ class MockGLES2Decoder : public GLES2Decoder {
uint32 parent_texture_id));
MOCK_METHOD0(Destroy, void());
MOCK_METHOD1(ResizeOffscreenFrameBuffer, void(const gfx::Size& size));
+ MOCK_METHOD0(UpdateOffscreenFrameBufferSize, bool());
MOCK_METHOD0(MakeCurrent, bool());
MOCK_METHOD1(GetServiceIdForTesting, uint32(uint32 client_id));
MOCK_METHOD0(GetGLES2Util, GLES2Util*());
diff --git a/gpu/command_buffer/service/gpu_processor_mac.cc b/gpu/command_buffer/service/gpu_processor_mac.cc
index 91b387c..d47681f 100644
--- a/gpu/command_buffer/service/gpu_processor_mac.cc
+++ b/gpu/command_buffer/service/gpu_processor_mac.cc
@@ -71,6 +71,7 @@ void GPUProcessor::Destroy() {
uint64 GPUProcessor::SetWindowSizeForIOSurface(const gfx::Size& size) {
#if !defined(UNIT_TEST)
ResizeOffscreenFrameBuffer(size);
+ decoder_->UpdateOffscreenFrameBufferSize();
return surface_->SetSurfaceSize(size);
#else
return 0;
@@ -81,6 +82,7 @@ TransportDIB::Handle GPUProcessor::SetWindowSizeForTransportDIB(
const gfx::Size& size) {
#if !defined(UNIT_TEST)
ResizeOffscreenFrameBuffer(size);
+ decoder_->UpdateOffscreenFrameBufferSize();
return surface_->SetTransportDIBSize(size);
#else
return TransportDIB::DefaultHandleValue();