summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service
diff options
context:
space:
mode:
Diffstat (limited to 'gpu/command_buffer/service')
-rw-r--r--gpu/command_buffer/service/gl_surface_mock.h2
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc19
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.h5
-rw-r--r--gpu/command_buffer/service/in_process_command_buffer.cc10
-rw-r--r--gpu/command_buffer/service/in_process_command_buffer.h1
5 files changed, 6 insertions, 31 deletions
diff --git a/gpu/command_buffer/service/gl_surface_mock.h b/gpu/command_buffer/service/gl_surface_mock.h
index 1d756d4..44cbcdd 100644
--- a/gpu/command_buffer/service/gl_surface_mock.h
+++ b/gpu/command_buffer/service/gl_surface_mock.h
@@ -17,7 +17,7 @@ class GLSurfaceMock : public gfx::GLSurface {
MOCK_METHOD0(Initialize, bool());
MOCK_METHOD0(Destroy, void());
- MOCK_METHOD1(Resize, bool(const gfx::Size& size));
+ MOCK_METHOD2(Resize, bool(const gfx::Size& size, float scale_factor));
MOCK_METHOD0(IsOffscreen, bool());
MOCK_METHOD0(SwapBuffers, gfx::SwapResult());
MOCK_METHOD4(PostSubBuffer,
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 34ae829..4b618c6 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -877,9 +877,6 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
void WaitForReadPixels(base::Closure callback) override;
- void SetResizeCallback(
- const base::Callback<void(gfx::Size, float)>& callback) override;
-
Logger* GetLogger() override;
void BeginDecoding() override;
@@ -2194,8 +2191,6 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
scoped_ptr<ImageManager> image_manager_;
- base::Callback<void(gfx::Size, float)> resize_callback_;
-
WaitSyncPointCallback wait_sync_point_callback_;
FenceSyncReleaseCallback fence_sync_release_callback_;
WaitFenceSyncCallback wait_fence_sync_callback_;
@@ -4135,11 +4130,6 @@ void GLES2DecoderImpl::UpdateParentTextureInfo() {
glBindTexture(target, texture_ref ? texture_ref->service_id() : 0);
}
-void GLES2DecoderImpl::SetResizeCallback(
- const base::Callback<void(gfx::Size, float)>& callback) {
- resize_callback_ = callback;
-}
-
Logger* GLES2DecoderImpl::GetLogger() {
return &logger_;
}
@@ -4536,10 +4526,11 @@ error::Error GLES2DecoderImpl::HandleResizeCHROMIUM(uint32 immediate_data_size,
<< "ResizeOffscreenFrameBuffer failed.";
return error::kLostContext;
}
- }
-
- if (!resize_callback_.is_null()) {
- resize_callback_.Run(gfx::Size(width, height), scale_factor);
+ } else {
+ if (!surface_->Resize(gfx::Size(width, height), scale_factor)) {
+ LOG(ERROR) << "GLES2DecoderImpl: Context lost because resize failed.";
+ return error::kLostContext;
+ }
DCHECK(context_->IsCurrent(surface_.get()));
if (!context_->IsCurrent(surface_.get())) {
LOG(ERROR) << "GLES2DecoderImpl: Context lost because context no longer "
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.h b/gpu/command_buffer/service/gles2_cmd_decoder.h
index 60ca384..ec870bf 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.h
@@ -203,11 +203,6 @@ class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>,
// Perform any idle work that needs to be made.
virtual void PerformIdleWork() = 0;
- // Sets a callback which is called when a glResizeCHROMIUM command
- // is processed.
- virtual void SetResizeCallback(
- const base::Callback<void(gfx::Size, float)>& callback) = 0;
-
// Get the service texture ID corresponding to a client texture ID.
// If no such record is found then return false.
virtual bool GetServiceTextureId(uint32 client_texture_id,
diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc
index 3b5f9d0..5401a48 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.cc
+++ b/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -198,12 +198,6 @@ InProcessCommandBuffer::~InProcessCommandBuffer() {
Destroy();
}
-void InProcessCommandBuffer::OnResizeView(gfx::Size size, float scale_factor) {
- CheckSequencedThread();
- DCHECK(!surface_->IsOffscreen());
- surface_->Resize(size);
-}
-
bool InProcessCommandBuffer::MakeCurrent() {
CheckSequencedThread();
command_buffer_lock_.AssertAcquired();
@@ -411,10 +405,6 @@ bool InProcessCommandBuffer::InitializeOnGpuThread(
}
*params.capabilities = decoder_->GetCapabilities();
- if (!params.is_offscreen) {
- decoder_->SetResizeCallback(base::Bind(
- &InProcessCommandBuffer::OnResizeView, gpu_thread_weak_ptr_));
- }
decoder_->SetWaitSyncPointCallback(
base::Bind(&InProcessCommandBuffer::WaitSyncPointOnGpuThread,
base::Unretained(this)));
diff --git a/gpu/command_buffer/service/in_process_command_buffer.h b/gpu/command_buffer/service/in_process_command_buffer.h
index dc33c35..83318b5 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.h
+++ b/gpu/command_buffer/service/in_process_command_buffer.h
@@ -236,7 +236,6 @@ class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer,
// Callbacks:
void OnContextLost();
- void OnResizeView(gfx::Size size, float scale_factor);
bool GetBufferChanged(int32 transfer_buffer_id);
void PumpCommands();
void PerformDelayedWork();