diff options
Diffstat (limited to 'cc')
-rw-r--r-- | cc/output/gl_renderer.cc | 5 | ||||
-rw-r--r-- | cc/resources/video_resource_updater.cc | 15 | ||||
-rw-r--r-- | cc/resources/video_resource_updater_unittest.cc | 13 | ||||
-rw-r--r-- | cc/test/test_web_graphics_context_3d.cc | 13 | ||||
-rw-r--r-- | cc/test/test_web_graphics_context_3d.h | 4 |
5 files changed, 5 insertions, 45 deletions
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc index 7febfff..e412282 100644 --- a/cc/output/gl_renderer.cc +++ b/cc/output/gl_renderer.cc @@ -2246,11 +2246,6 @@ void GLRenderer::GetFramebufferPixelsAsync( gpu::Mailbox mailbox; if (own_mailbox) { GLC(gl_, gl_->GenMailboxCHROMIUM(mailbox.name)); - if (mailbox.IsZero()) { - gl_->DeleteTextures(1, &texture_id); - request->SendEmptyResult(); - return; - } } else { mailbox = request->texture_mailbox().mailbox(); DCHECK_EQ(static_cast<unsigned>(GL_TEXTURE_2D), diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc index bd91417..b170be6 100644 --- a/cc/resources/video_resource_updater.cc +++ b/cc/resources/video_resource_updater.cc @@ -213,16 +213,11 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes( gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); GLC(gl, gl->GenMailboxCHROMIUM(mailbox.name)); - if (mailbox.IsZero()) { - resource_provider_->DeleteResource(resource_id); - resource_id = 0; - } else { - ResourceProvider::ScopedWriteLockGL lock( - resource_provider_, resource_id); - GLC(gl, gl->BindTexture(GL_TEXTURE_2D, lock.texture_id())); - GLC(gl, gl->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name)); - GLC(gl, gl->BindTexture(GL_TEXTURE_2D, 0)); - } + ResourceProvider::ScopedWriteLockGL lock(resource_provider_, + resource_id); + GLC(gl, gl->BindTexture(GL_TEXTURE_2D, lock.texture_id())); + GLC(gl, gl->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name)); + GLC(gl, gl->BindTexture(GL_TEXTURE_2D, 0)); } if (resource_id) diff --git a/cc/resources/video_resource_updater_unittest.cc b/cc/resources/video_resource_updater_unittest.cc index dcb72e3..af1cea4 100644 --- a/cc/resources/video_resource_updater_unittest.cc +++ b/cc/resources/video_resource_updater_unittest.cc @@ -67,18 +67,5 @@ TEST_F(VideoResourceUpdaterTest, SoftwareFrame) { EXPECT_EQ(VideoFrameExternalResources::YUV_RESOURCE, resources.type); } -TEST_F(VideoResourceUpdaterTest, LostContextForSoftwareFrame) { - VideoResourceUpdater updater(output_surface3d_->context_provider().get(), - resource_provider3d_.get()); - scoped_refptr<media::VideoFrame> video_frame = CreateTestYUVVideoFrame(); - - // Fail while creating the mailbox for the second YUV plane. - context3d_->set_times_gen_mailbox_succeeds(1); - - VideoFrameExternalResources resources = - updater.CreateExternalResourcesFromVideoFrame(video_frame); - EXPECT_EQ(VideoFrameExternalResources::NONE, resources.type); -} - } // namespace } // namespace cc diff --git a/cc/test/test_web_graphics_context_3d.cc b/cc/test/test_web_graphics_context_3d.cc index 27a7b4c..59b7440 100644 --- a/cc/test/test_web_graphics_context_3d.cc +++ b/cc/test/test_web_graphics_context_3d.cc @@ -52,7 +52,6 @@ TestWebGraphicsContext3D::TestWebGraphicsContext3D() : context_id_(s_context_id++), times_bind_texture_succeeds_(-1), times_end_query_succeeds_(-1), - times_gen_mailbox_succeeds_(-1), context_lost_(false), times_map_image_chromium_succeeds_(-1), times_map_buffer_chromium_succeeds_(-1), @@ -428,18 +427,6 @@ void TestWebGraphicsContext3D::getShaderPrecisionFormat(GLenum shadertype, } void TestWebGraphicsContext3D::genMailboxCHROMIUM(GLbyte* mailbox) { - if (times_gen_mailbox_succeeds_ >= 0) { - if (!times_gen_mailbox_succeeds_) { - loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB, - GL_INNOCENT_CONTEXT_RESET_ARB); - } - --times_gen_mailbox_succeeds_; - } - if (context_lost_) { - memset(mailbox, 0, GL_MAILBOX_SIZE_CHROMIUM); - return; - } - static char mailbox_name1 = '1'; static char mailbox_name2 = '1'; mailbox[0] = mailbox_name1; diff --git a/cc/test/test_web_graphics_context_3d.h b/cc/test/test_web_graphics_context_3d.h index 1300a8f..39f8767 100644 --- a/cc/test/test_web_graphics_context_3d.h +++ b/cc/test/test_web_graphics_context_3d.h @@ -263,9 +263,6 @@ class TestWebGraphicsContext3D { void set_times_end_query_succeeds(int times) { times_end_query_succeeds_ = times; } - void set_times_gen_mailbox_succeeds(int times) { - times_gen_mailbox_succeeds_ = times; - } // When set, mapImageCHROMIUM and mapBufferCHROMIUM will return NULL after // this many times. @@ -414,7 +411,6 @@ class TestWebGraphicsContext3D { ContextProvider::Capabilities test_capabilities_; int times_bind_texture_succeeds_; int times_end_query_succeeds_; - int times_gen_mailbox_succeeds_; bool context_lost_; int times_map_image_chromium_succeeds_; int times_map_buffer_chromium_succeeds_; |