summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreveman <reveman@chromium.org>2014-10-03 16:27:07 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-03 23:27:25 +0000
commit70672e94d9e6596d70fa5e59b49deecb5ae2fae1 (patch)
treed1dc9b5246a89774c80d51f71e81e519d9a8a0c9
parent9f7cc9935d1ba9143e61e2a74e288c866053722d (diff)
downloadchromium_src-70672e94d9e6596d70fa5e59b49deecb5ae2fae1.zip
chromium_src-70672e94d9e6596d70fa5e59b49deecb5ae2fae1.tar.gz
chromium_src-70672e94d9e6596d70fa5e59b49deecb5ae2fae1.tar.bz2
content: Use CHROMIUM_gpu_memory_buffer_image instead of CHROMIUM_image for BufferQueue.
This is now the preferred way to create an image when it doesn't need to be mapped as the implementation can chose whatever pixel format is ideal with for the current platform and driver. BUG=418553 Review URL: https://codereview.chromium.org/615963002 Cr-Commit-Position: refs/heads/master@{#298115}
-rw-r--r--content/browser/compositor/buffer_queue.cc12
-rw-r--r--content/browser/compositor/buffer_queue_unittest.cc16
-rw-r--r--content/browser/compositor/gpu_process_transport_factory.cc2
3 files changed, 15 insertions, 15 deletions
diff --git a/content/browser/compositor/buffer_queue.cc b/content/browser/compositor/buffer_queue.cc
index f265fcc..2121059 100644
--- a/content/browser/compositor/buffer_queue.cc
+++ b/content/browser/compositor/buffer_queue.cc
@@ -155,13 +155,13 @@ BufferQueue::AllocatedSurface BufferQueue::GetNextSurface() {
// We don't want to allow anything more than triple buffering.
DCHECK_LT(allocated_count_, 4U);
- unsigned int id = gl->CreateImageCHROMIUM(
- size_.width(),
- size_.height(),
- internalformat_,
- GL_IMAGE_SCANOUT_CHROMIUM);
+ unsigned int id =
+ gl->CreateGpuMemoryBufferImageCHROMIUM(size_.width(),
+ size_.height(),
+ internalformat_,
+ GL_SCANOUT_CHROMIUM);
if (!id) {
- LOG(ERROR) << "Failed to allocate backing CreateImageCHROMIUM surface";
+ LOG(ERROR) << "Failed to allocate backing image surface";
gl->DeleteTextures(1, &texture);
return AllocatedSurface();
}
diff --git a/content/browser/compositor/buffer_queue_unittest.cc b/content/browser/compositor/buffer_queue_unittest.cc
index f4c66fb..6f61487 100644
--- a/content/browser/compositor/buffer_queue_unittest.cc
+++ b/content/browser/compositor/buffer_queue_unittest.cc
@@ -36,7 +36,7 @@ class BufferQueueTest : public ::testing::Test {
scoped_refptr<cc::TestContextProvider> context_provider =
cc::TestContextProvider::Create(cc::TestWebGraphicsContext3D::Create());
context_provider->BindToCurrentThread();
- output_surface_.reset(new MockBufferQueue(context_provider, GL_RGBA8_OES));
+ output_surface_.reset(new MockBufferQueue(context_provider, GL_RGBA));
output_surface_->Initialize();
}
@@ -119,7 +119,8 @@ class MockedContext : public cc::TestWebGraphicsContext3D {
MOCK_METHOD2(bindFramebuffer, void(GLenum, GLuint));
MOCK_METHOD2(bindTexture, void(GLenum, GLuint));
MOCK_METHOD2(bindTexImage2DCHROMIUM, void(GLenum, GLint));
- MOCK_METHOD4(createImageCHROMIUM, GLuint(GLsizei, GLsizei, GLenum, GLenum));
+ MOCK_METHOD4(createGpuMemoryBufferImageCHROMIUM,
+ GLuint(GLsizei, GLsizei, GLenum, GLenum));
MOCK_METHOD1(destroyImageCHROMIUM, void(GLuint));
MOCK_METHOD5(framebufferTexture2D,
void(GLenum, GLenum, GLenum, GLuint, GLint));
@@ -132,7 +133,7 @@ scoped_ptr<BufferQueue> CreateOutputSurfaceWithMock(MockedContext** context) {
scoped_ptr<cc::TestWebGraphicsContext3D>(*context));
context_provider->BindToCurrentThread();
scoped_ptr<BufferQueue> buffer_queue(
- new BufferQueue(context_provider, GL_RGBA8_OES));
+ new BufferQueue(context_provider, GL_RGBA));
buffer_queue->Initialize();
return buffer_queue.Pass();
}
@@ -155,11 +156,10 @@ TEST(BufferQueueStandaloneTest, FboBinding) {
CreateOutputSurfaceWithMock(&context);
EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, Ne(0U)));
EXPECT_CALL(*context, destroyImageCHROMIUM(1));
- Expectation image =
- EXPECT_CALL(
- *context,
- createImageCHROMIUM(0, 0, GL_RGBA8_OES, GL_IMAGE_SCANOUT_CHROMIUM))
- .WillOnce(Return(1));
+ Expectation image = EXPECT_CALL(*context,
+ createGpuMemoryBufferImageCHROMIUM(
+ 0, 0, GL_RGBA, GL_IMAGE_SCANOUT_CHROMIUM))
+ .WillOnce(Return(1));
Expectation fb =
EXPECT_CALL(*context, bindFramebuffer(GL_FRAMEBUFFER, Ne(0U)));
Expectation tex = EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, Ne(0U)));
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc
index 7db1620..36b3e0c 100644
--- a/content/browser/compositor/gpu_process_transport_factory.cc
+++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -234,7 +234,7 @@ scoped_ptr<cc::OutputSurface> GpuProcessTransportFactory::CreateOutputSurface(
&output_surface_map_,
compositor->vsync_manager(),
CreateOverlayCandidateValidator(compositor->widget()),
- GL_RGB8_OES));
+ GL_RGB));
}
#endif
if (!surface)