summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authornduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-22 17:09:59 +0000
committernduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-22 17:09:59 +0000
commit799b4b2342f2ce5837c8b36bd419eb6f40625f3b (patch)
treeec20862106f4d01e0c87dc6bb967ab103cb3c350 /gpu
parent530724d2c2949d7c6823f6065004c9335388920f (diff)
downloadchromium_src-799b4b2342f2ce5837c8b36bd419eb6f40625f3b.zip
chromium_src-799b4b2342f2ce5837c8b36bd419eb6f40625f3b.tar.gz
chromium_src-799b4b2342f2ce5837c8b36bd419eb6f40625f3b.tar.bz2
Unify MacOS resizing path with glResizeCHROMIUM.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=97644 Review URL: http://codereview.chromium.org/7671035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97668 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rwxr-xr-xgpu/command_buffer/build_gles2_cmd_buffer.py3
-rw-r--r--gpu/command_buffer/client/gles2_implementation.cc7
-rw-r--r--gpu/command_buffer/client/gles2_implementation_autogen.h5
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc323
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.h10
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_autogen.h8
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_mock.h3
-rw-r--r--gpu/command_buffer/service/gpu_scheduler.cc7
-rw-r--r--gpu/command_buffer/service/gpu_scheduler.h3
-rw-r--r--gpu/command_buffer/service/gpu_scheduler_mac.cc9
10 files changed, 174 insertions, 204 deletions
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index 574897e..b09e24a 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -1727,7 +1727,8 @@ _FUNCTION_INFO = {
'GLsizei stride, GLuint offset',
},
'ResizeCHROMIUM': {
- 'decoder_func': 'DoResizeCHROMIUM',
+ 'type': 'Custom',
+ 'impl_func': False,
'unit_test': False,
'extension': True,
'chromium': True,
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index e34e476..956ac62 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -2482,6 +2482,12 @@ void GLES2Implementation::UnmapTexSubImage2DCHROMIUM(const void* mem) {
mapped_textures_.erase(it);
}
+void GLES2Implementation::ResizeCHROMIUM(GLuint width, GLuint height) {
+ GPU_CLIENT_LOG("[" << this << "] glResizeCHROMIUM("
+ << width << ", " << height << ")");
+ helper_->ResizeCHROMIUM(width, height);
+}
+
const GLchar* GLES2Implementation::GetRequestableExtensionsCHROMIUM() {
GPU_CLIENT_LOG("[" << this << "] glGetRequestableExtensionsCHROMIUM()");
TRACE_EVENT0("gpu",
@@ -2625,4 +2631,3 @@ void GLES2Implementation::GetProgramInfoCHROMIUM(
} // namespace gles2
} // namespace gpu
-
diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h
index ba061a5..021e3e9 100644
--- a/gpu/command_buffer/client/gles2_implementation_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_autogen.h
@@ -1254,10 +1254,7 @@ void* MapTexSubImage2DCHROMIUM(
void UnmapTexSubImage2DCHROMIUM(const void* mem);
-void ResizeCHROMIUM(GLuint width, GLuint height) {
- GPU_CLIENT_LOG("[" << this << "] glResizeCHROMIUM(" << width << ", " << height << ")"); // NOLINT
- helper_->ResizeCHROMIUM(width, height);
-}
+void ResizeCHROMIUM(GLuint width, GLuint height);
const GLchar* GetRequestableExtensionsCHROMIUM();
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 4f35103..5e500bb 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -468,8 +468,7 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
virtual void Destroy();
virtual bool SetParent(GLES2Decoder* parent_decoder,
uint32 parent_texture_id);
- virtual void ResizeOffscreenFrameBuffer(const gfx::Size& size);
- virtual bool UpdateOffscreenFrameBufferSize();
+ virtual bool ResizeOffscreenFrameBuffer(const gfx::Size& size);
void UpdateParentTextureInfo();
virtual bool MakeCurrent();
virtual GLES2Util* GetGLES2Util() { return &util_; }
@@ -1035,8 +1034,6 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
// Wrapper for glValidateProgram.
void DoValidateProgram(GLuint program_client_id);
- void DoResizeCHROMIUM(GLuint width, GLuint height);
-
void DoSetSurfaceCHROMIUM(GLint surface_id);
// Gets the number of values that will be returned by glGetXXX. Returns
@@ -1181,10 +1178,6 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
// The parent pointer is reset if the parent is destroyed.
base::WeakPtr<GLES2DecoderImpl> parent_;
- // Width and height to which an offscreen frame buffer should be resized on
- // the next call to SwapBuffers.
- gfx::Size pending_offscreen_size_;
-
// Current width and height of the offscreen frame buffer.
gfx::Size offscreen_size_;
@@ -1917,8 +1910,7 @@ bool GLES2DecoderImpl::Initialize(
// Allocate the render buffers at their initial size and check the status
// of the frame buffers is okay.
- pending_offscreen_size_ = size;
- if (!UpdateOffscreenFrameBufferSize()) {
+ if (!ResizeOffscreenFrameBuffer(size)) {
LOG(ERROR) << "Could not allocate offscreen buffer storage.";
Destroy();
return false;
@@ -2226,140 +2218,6 @@ GLenum GLES2DecoderImpl::GetBoundDrawFrameBufferInternalFormat() {
}
}
-bool GLES2DecoderImpl::UpdateOffscreenFrameBufferSize() {
- if (offscreen_size_ == pending_offscreen_size_)
- return true;
-
- offscreen_size_ = pending_offscreen_size_;
- int w = offscreen_size_.width();
- int h = offscreen_size_.height();
- if (w < 0 || h < 0 || h >= (INT_MAX / 4) / (w ? w : 1)) {
- LOG(ERROR) << "GLES2DecoderImpl::UpdateOffscreenFrameBufferSize failed "
- << "to allocate storage due to excessive dimensions.";
- return false;
- }
-
- // Reallocate the offscreen target buffers.
- DCHECK(offscreen_target_color_format_);
- if (IsOffscreenBufferMultisampled()) {
- if (!offscreen_target_color_render_buffer_->AllocateStorage(
- pending_offscreen_size_, offscreen_target_color_format_,
- offscreen_target_samples_)) {
- LOG(ERROR) << "GLES2DecoderImpl::UpdateOffscreenFrameBufferSize failed "
- << "to allocate storage for offscreen target color buffer.";
- return false;
- }
- } else {
- if (!offscreen_target_color_texture_->AllocateStorage(
- pending_offscreen_size_, offscreen_target_color_format_)) {
- LOG(ERROR) << "GLES2DecoderImpl::UpdateOffscreenFrameBufferSize failed "
- << "to allocate storage for offscreen target color texture.";
- return false;
- }
- }
- if (offscreen_target_depth_format_ &&
- !offscreen_target_depth_render_buffer_->AllocateStorage(
- pending_offscreen_size_, offscreen_target_depth_format_,
- offscreen_target_samples_)) {
- LOG(ERROR) << "GLES2DecoderImpl::UpdateOffscreenFrameBufferSize failed "
- << "to allocate storage for offscreen target depth buffer.";
- return false;
- }
- if (offscreen_target_stencil_format_ &&
- !offscreen_target_stencil_render_buffer_->AllocateStorage(
- pending_offscreen_size_, offscreen_target_stencil_format_,
- offscreen_target_samples_)) {
- LOG(ERROR) << "GLES2DecoderImpl::UpdateOffscreenFrameBufferSize failed "
- << "to allocate storage for offscreen target stencil buffer.";
- return false;
- }
-
- // Attach the offscreen target buffers to the target frame buffer.
- if (IsOffscreenBufferMultisampled()) {
- offscreen_target_frame_buffer_->AttachRenderBuffer(
- GL_COLOR_ATTACHMENT0,
- offscreen_target_color_render_buffer_.get());
- } else {
- offscreen_target_frame_buffer_->AttachRenderTexture(
- offscreen_target_color_texture_.get());
- }
- if (offscreen_target_depth_format_) {
- offscreen_target_frame_buffer_->AttachRenderBuffer(
- GL_DEPTH_ATTACHMENT,
- offscreen_target_depth_render_buffer_.get());
- }
- const bool packed_depth_stencil =
- offscreen_target_depth_format_ == GL_DEPTH24_STENCIL8;
- if (packed_depth_stencil) {
- offscreen_target_frame_buffer_->AttachRenderBuffer(
- GL_STENCIL_ATTACHMENT,
- offscreen_target_depth_render_buffer_.get());
- } else if (offscreen_target_stencil_format_) {
- offscreen_target_frame_buffer_->AttachRenderBuffer(
- GL_STENCIL_ATTACHMENT,
- offscreen_target_stencil_render_buffer_.get());
- }
-
- if (offscreen_target_frame_buffer_->CheckStatus() !=
- GL_FRAMEBUFFER_COMPLETE) {
- LOG(ERROR) << "GLES2DecoderImpl::UpdateOffscreenFrameBufferSize failed "
- << "because offscreen FBO was incomplete.";
- return false;
- }
-
- // Clear the target frame buffer.
- {
- ScopedFrameBufferBinder binder(this, offscreen_target_frame_buffer_->id());
- glClearColor(0, 0, 0, (GLES2Util::GetChannelsForFormat(
- offscreen_target_color_format_) & 0x0008) != 0 ? 0 : 1);
- glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
- glClearStencil(0);
- glStencilMaskSeparate(GL_FRONT, -1);
- glStencilMaskSeparate(GL_BACK, -1);
- glClearDepth(0);
- glDepthMask(GL_TRUE);
- glDisable(GL_SCISSOR_TEST);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
- RestoreClearState();
- }
-
- // Allocate the offscreen saved color texture.
- DCHECK(offscreen_saved_color_format_);
- offscreen_saved_color_texture_->AllocateStorage(
- pending_offscreen_size_, offscreen_saved_color_format_);
-
- offscreen_saved_frame_buffer_->AttachRenderTexture(
- offscreen_saved_color_texture_.get());
- if (offscreen_saved_frame_buffer_->CheckStatus() !=
- GL_FRAMEBUFFER_COMPLETE) {
- LOG(ERROR) << "GLES2DecoderImpl::UpdateOffscreenFrameBufferSize failed "
- << "because offscreen saved FBO was incomplete.";
- return false;
- }
-
- // Destroy the offscreen resolved framebuffers.
- if (offscreen_resolved_frame_buffer_.get())
- offscreen_resolved_frame_buffer_->Destroy();
- if (offscreen_resolved_color_texture_.get())
- offscreen_resolved_color_texture_->Destroy();
- offscreen_resolved_color_texture_.reset();
- offscreen_resolved_frame_buffer_.reset();
-
- // Clear the offscreen color texture.
- {
- ScopedFrameBufferBinder binder(this, offscreen_saved_frame_buffer_->id());
- glClearColor(0, 0, 0, 0);
- glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
- glDisable(GL_SCISSOR_TEST);
- glClear(GL_COLOR_BUFFER_BIT);
- RestoreClearState();
- }
-
- UpdateParentTextureInfo();
-
- return true;
-}
-
void GLES2DecoderImpl::UpdateParentTextureInfo() {
if (parent_) {
// Update the info about the offscreen saved color texture in the parent.
@@ -2378,8 +2236,8 @@ void GLES2DecoderImpl::UpdateParentTextureInfo() {
GL_TEXTURE_2D,
0, // level
GL_RGBA,
- pending_offscreen_size_.width(),
- pending_offscreen_size_.height(),
+ offscreen_size_.width(),
+ offscreen_size_.height(),
1, // depth
0, // border
GL_RGBA,
@@ -2407,7 +2265,8 @@ void GLES2DecoderImpl::UpdateParentTextureInfo() {
}
}
-void GLES2DecoderImpl::SetResizeCallback(Callback1<gfx::Size>::Type* callback) {
+void GLES2DecoderImpl::SetResizeCallback(
+ Callback1<gfx::Size>::Type* callback) {
resize_callback_.reset(callback);
}
@@ -2553,22 +2412,166 @@ bool GLES2DecoderImpl::SetParent(GLES2Decoder* new_parent,
return true;
}
-void GLES2DecoderImpl::ResizeOffscreenFrameBuffer(const gfx::Size& size) {
- // We can't resize the render buffers immediately because there might be a
- // partial frame rendered into them and we don't want the tail end of that
- // rendered into the reallocated storage. Defer until the next SwapBuffers.
- pending_offscreen_size_ = size;
+bool GLES2DecoderImpl::ResizeOffscreenFrameBuffer(const gfx::Size& size) {
+ bool is_offscreen = !!offscreen_target_frame_buffer_.get();
+ if (!is_offscreen) {
+ LOG(ERROR) << "GLES2DecoderImpl::ResizeOffscreenFrameBuffer called "
+ << " with an onscreen framebuffer.";
+ return false;
+ }
+
+ if (offscreen_size_ == size)
+ return true;
+
+ offscreen_size_ = size;
+ int w = offscreen_size_.width();
+ int h = offscreen_size_.height();
+ if (w < 0 || h < 0 || h >= (INT_MAX / 4) / (w ? w : 1)) {
+ LOG(ERROR) << "GLES2DecoderImpl::ResizeOffscreenFrameBuffer failed "
+ << "to allocate storage due to excessive dimensions.";
+ return false;
+ }
+
+ // Reallocate the offscreen target buffers.
+ DCHECK(offscreen_target_color_format_);
+ if (IsOffscreenBufferMultisampled()) {
+ if (!offscreen_target_color_render_buffer_->AllocateStorage(
+ offscreen_size_, offscreen_target_color_format_,
+ offscreen_target_samples_)) {
+ LOG(ERROR) << "GLES2DecoderImpl::ResizeOffscreenFrameBuffer failed "
+ << "to allocate storage for offscreen target color buffer.";
+ return false;
+ }
+ } else {
+ if (!offscreen_target_color_texture_->AllocateStorage(
+ offscreen_size_, offscreen_target_color_format_)) {
+ LOG(ERROR) << "GLES2DecoderImpl::ResizeOffscreenFrameBuffer failed "
+ << "to allocate storage for offscreen target color texture.";
+ return false;
+ }
+ }
+ if (offscreen_target_depth_format_ &&
+ !offscreen_target_depth_render_buffer_->AllocateStorage(
+ offscreen_size_, offscreen_target_depth_format_,
+ offscreen_target_samples_)) {
+ LOG(ERROR) << "GLES2DecoderImpl::ResizeOffscreenFrameBuffer failed "
+ << "to allocate storage for offscreen target depth buffer.";
+ return false;
+ }
+ if (offscreen_target_stencil_format_ &&
+ !offscreen_target_stencil_render_buffer_->AllocateStorage(
+ offscreen_size_, offscreen_target_stencil_format_,
+ offscreen_target_samples_)) {
+ LOG(ERROR) << "GLES2DecoderImpl::ResizeOffscreenFrameBuffer failed "
+ << "to allocate storage for offscreen target stencil buffer.";
+ return false;
+ }
+
+ // Attach the offscreen target buffers to the target frame buffer.
+ if (IsOffscreenBufferMultisampled()) {
+ offscreen_target_frame_buffer_->AttachRenderBuffer(
+ GL_COLOR_ATTACHMENT0,
+ offscreen_target_color_render_buffer_.get());
+ } else {
+ offscreen_target_frame_buffer_->AttachRenderTexture(
+ offscreen_target_color_texture_.get());
+ }
+ if (offscreen_target_depth_format_) {
+ offscreen_target_frame_buffer_->AttachRenderBuffer(
+ GL_DEPTH_ATTACHMENT,
+ offscreen_target_depth_render_buffer_.get());
+ }
+ const bool packed_depth_stencil =
+ offscreen_target_depth_format_ == GL_DEPTH24_STENCIL8;
+ if (packed_depth_stencil) {
+ offscreen_target_frame_buffer_->AttachRenderBuffer(
+ GL_STENCIL_ATTACHMENT,
+ offscreen_target_depth_render_buffer_.get());
+ } else if (offscreen_target_stencil_format_) {
+ offscreen_target_frame_buffer_->AttachRenderBuffer(
+ GL_STENCIL_ATTACHMENT,
+ offscreen_target_stencil_render_buffer_.get());
+ }
+
+ if (offscreen_target_frame_buffer_->CheckStatus() !=
+ GL_FRAMEBUFFER_COMPLETE) {
+ LOG(ERROR) << "GLES2DecoderImpl::ResizeOffscreenFrameBuffer failed "
+ << "because offscreen FBO was incomplete.";
+ return false;
+ }
+
+ // Clear the target frame buffer.
+ {
+ ScopedFrameBufferBinder binder(this, offscreen_target_frame_buffer_->id());
+ glClearColor(0, 0, 0, (GLES2Util::GetChannelsForFormat(
+ offscreen_target_color_format_) & 0x0008) != 0 ? 0 : 1);
+ glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
+ glClearStencil(0);
+ glStencilMaskSeparate(GL_FRONT, -1);
+ glStencilMaskSeparate(GL_BACK, -1);
+ glClearDepth(0);
+ glDepthMask(GL_TRUE);
+ glDisable(GL_SCISSOR_TEST);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+ RestoreClearState();
+ }
+
+ // Allocate the offscreen saved color texture.
+ DCHECK(offscreen_saved_color_format_);
+ offscreen_saved_color_texture_->AllocateStorage(
+ offscreen_size_, offscreen_saved_color_format_);
+
+ offscreen_saved_frame_buffer_->AttachRenderTexture(
+ offscreen_saved_color_texture_.get());
+ if (offscreen_saved_frame_buffer_->CheckStatus() !=
+ GL_FRAMEBUFFER_COMPLETE) {
+ LOG(ERROR) << "GLES2DecoderImpl::ResizeOffscreenFrameBuffer failed "
+ << "because offscreen saved FBO was incomplete.";
+ return false;
+ }
+
+ // Destroy the offscreen resolved framebuffers.
+ if (offscreen_resolved_frame_buffer_.get())
+ offscreen_resolved_frame_buffer_->Destroy();
+ if (offscreen_resolved_color_texture_.get())
+ offscreen_resolved_color_texture_->Destroy();
+ offscreen_resolved_color_texture_.reset();
+ offscreen_resolved_frame_buffer_.reset();
+
+ // Clear the offscreen color texture.
+ {
+ ScopedFrameBufferBinder binder(this, offscreen_saved_frame_buffer_->id());
+ glClearColor(0, 0, 0, 0);
+ glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
+ glDisable(GL_SCISSOR_TEST);
+ glClear(GL_COLOR_BUFFER_BIT);
+ RestoreClearState();
+ }
+
+ UpdateParentTextureInfo();
+
+ return true;
}
-void GLES2DecoderImpl::DoResizeCHROMIUM(GLuint width, GLuint height) {
+error::Error GLES2DecoderImpl::HandleResizeCHROMIUM(
+ uint32 immediate_data_size, const gles2::ResizeCHROMIUM& c) {
+ GLuint width = static_cast<GLuint>(c.width);
+ GLuint height = static_cast<GLuint>(c.height);
+ TRACE_EVENT2("gpu", "glResizeChromium", "width", width, "height", height);
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(TOUCH_UI)
// 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);
+ bool is_offscreen = !!offscreen_target_frame_buffer_.get();
+ if (is_offscreen) {
+ if (!ResizeOffscreenFrameBuffer(gfx::Size(width, height)))
+ return error::kLostContext;
}
+
+ if (resize_callback_.get())
+ resize_callback_->Run(gfx::Size(width, height));
+
+ return error::kNoError;
}
void GLES2DecoderImpl::DoSetSurfaceCHROMIUM(GLint surface_id) {
@@ -6554,14 +6557,6 @@ error::Error GLES2DecoderImpl::HandleSwapBuffers(
if (is_offscreen) {
ScopedGLErrorSuppressor suppressor(this);
- // First check to see if a deferred offscreen render buffer resize is
- // pending.
- if (!UpdateOffscreenFrameBufferSize()) {
- LOG(ERROR) << "Context lost because reallocation of offscreen FBO "
- << "failed.";
- return error::kLostContext;
- }
-
if (IsOffscreenBufferMultisampled()) {
// For multisampled buffers, bind the resolved frame buffer so that
// callbacks can call ReadPixels or CopyTexImage2D.
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.h b/gpu/command_buffer/service/gles2_cmd_decoder.h
index 23c5e3a..fc66b3d 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.h
@@ -81,12 +81,7 @@ class GLES2Decoder : public CommonDecoder {
uint32 parent_texture_id) = 0;
// 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;
+ virtual bool ResizeOffscreenFrameBuffer(const gfx::Size& size) = 0;
// Make this decoder's GL context current.
virtual bool MakeCurrent() = 0;
@@ -105,7 +100,8 @@ class GLES2Decoder : public CommonDecoder {
// Sets a callback which is called when a glResizeCHROMIUM command
// is processed.
- virtual void SetResizeCallback(Callback1<gfx::Size>::Type* callback) = 0;
+ virtual void SetResizeCallback(
+ Callback1<gfx::Size>::Type* callback) = 0;
// Sets a callback which is called when a SwapBuffers command is processed.
virtual void SetSwapBuffersCallback(Callback0::Type* callback) = 0;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
index 9023cfe..27ef39b 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
@@ -2568,14 +2568,6 @@ error::Error GLES2DecoderImpl::HandleGetMaxValueInBufferCHROMIUM(
return error::kNoError;
}
-error::Error GLES2DecoderImpl::HandleResizeCHROMIUM(
- uint32 immediate_data_size, const gles2::ResizeCHROMIUM& c) {
- GLuint width = static_cast<GLuint>(c.width);
- GLuint height = static_cast<GLuint>(c.height);
- DoResizeCHROMIUM(width, height);
- return error::kNoError;
-}
-
error::Error GLES2DecoderImpl::HandleSetSurfaceCHROMIUM(
uint32 immediate_data_size, const gles2::SetSurfaceCHROMIUM& c) {
GLint surface_id = static_cast<GLint>(c.surface_id);
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
index 13e60bb..fa9d43d 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
@@ -38,8 +38,7 @@ class MockGLES2Decoder : public GLES2Decoder {
const std::vector<int32>& attribs));
MOCK_METHOD0(Destroy, void());
MOCK_METHOD2(SetParent, bool(GLES2Decoder* parent, uint32 parent_texture_id));
- MOCK_METHOD1(ResizeOffscreenFrameBuffer, void(const gfx::Size& size));
- MOCK_METHOD0(UpdateOffscreenFrameBufferSize, bool());
+ MOCK_METHOD1(ResizeOffscreenFrameBuffer, bool(const gfx::Size& size));
MOCK_METHOD0(MakeCurrent, bool());
MOCK_METHOD1(GetServiceIdForTesting, uint32(uint32 client_id));
MOCK_METHOD0(GetGLES2Util, GLES2Util*());
diff --git a/gpu/command_buffer/service/gpu_scheduler.cc b/gpu/command_buffer/service/gpu_scheduler.cc
index 15316ea..6413cc1 100644
--- a/gpu/command_buffer/service/gpu_scheduler.cc
+++ b/gpu/command_buffer/service/gpu_scheduler.cc
@@ -228,11 +228,8 @@ int32 GpuScheduler::GetGetOffset() {
return parser_->get();
}
-void GpuScheduler::ResizeOffscreenFrameBuffer(const gfx::Size& size) {
- decoder_->ResizeOffscreenFrameBuffer(size);
-}
-
-void GpuScheduler::SetResizeCallback(Callback1<gfx::Size>::Type* callback) {
+void GpuScheduler::SetResizeCallback(
+ Callback1<gfx::Size>::Type* callback) {
decoder_->SetResizeCallback(callback);
}
diff --git a/gpu/command_buffer/service/gpu_scheduler.h b/gpu/command_buffer/service/gpu_scheduler.h
index 75ccc63..61c60be 100644
--- a/gpu/command_buffer/service/gpu_scheduler.h
+++ b/gpu/command_buffer/service/gpu_scheduler.h
@@ -98,9 +98,6 @@ class GpuScheduler : public CommandBufferEngine {
virtual bool SetGetOffset(int32 offset);
virtual int32 GetGetOffset();
- // Asynchronously resizes an offscreen frame buffer.
- void ResizeOffscreenFrameBuffer(const gfx::Size& size);
-
#if defined(OS_MACOSX)
// To prevent the GPU process from overloading the browser process,
// we need to track the number of swap buffers calls issued and
diff --git a/gpu/command_buffer/service/gpu_scheduler_mac.cc b/gpu/command_buffer/service/gpu_scheduler_mac.cc
index cfa0d5c..2efa9cb 100644
--- a/gpu/command_buffer/service/gpu_scheduler_mac.cc
+++ b/gpu/command_buffer/service/gpu_scheduler_mac.cc
@@ -74,21 +74,12 @@ void GpuScheduler::Destroy() {
}
uint64 GpuScheduler::SetWindowSizeForIOSurface(const gfx::Size& size) {
- // This is called from an IPC handler, so it's undefined which context is
- // current. Make sure the right one is.
- decoder_->GetGLContext()->MakeCurrent(decoder_->GetGLSurface());
-
- ResizeOffscreenFrameBuffer(size);
- decoder_->UpdateOffscreenFrameBufferSize();
-
// Note: The following line changes the current context again.
return surface_->SetSurfaceSize(size);
}
TransportDIB::Handle GpuScheduler::SetWindowSizeForTransportDIB(
const gfx::Size& size) {
- ResizeOffscreenFrameBuffer(size);
- decoder_->UpdateOffscreenFrameBufferSize();
return surface_->SetTransportDIBSize(size);
}