summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer
diff options
context:
space:
mode:
authorbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-09 14:25:57 +0000
committerbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-09 14:25:57 +0000
commit6b13d3ea6db2af7d4a5f003b8ef4c659971e85b0 (patch)
tree33cfa2c7f2c60f3b4e798fb088038a3ca6741905 /gpu/command_buffer
parent12bddbd96525629d64e050a41784c3dacec23466 (diff)
downloadchromium_src-6b13d3ea6db2af7d4a5f003b8ef4c659971e85b0.zip
chromium_src-6b13d3ea6db2af7d4a5f003b8ef4c659971e85b0.tar.gz
chromium_src-6b13d3ea6db2af7d4a5f003b8ef4c659971e85b0.tar.bz2
Aura: A little lighter GL synchronization
On the consumeTextureCHROMIUM(), we only need to synchronize on the channel. This can be accomplished with a shallowFlushCHROMIUM() rather than a flush(), the latter which implies a service side glFlush(). BUG=none TEST=by hand Review URL: https://chromiumcodereview.appspot.com/11779023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175796 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc16
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc30
2 files changed, 4 insertions, 42 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 32d94b0..c24d0aa 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -586,9 +586,6 @@ class GLES2DecoderImpl : public GLES2Decoder {
// Sets DEPTH_TEST, STENCIL_TEST and color mask for the current framebuffer.
void ApplyDirtyState();
- // Reapply the texture parameters to the given texture.
- void BindAndApplyTextureParameters(TextureManager::TextureInfo* info);
-
// These check the state of the currently bound framebuffer or the
// backbuffer if no framebuffer is bound.
bool BoundFramebufferHasColorAttachmentWithAlpha();
@@ -3564,15 +3561,6 @@ void GLES2DecoderImpl::ApplyDirtyState() {
}
}
-void GLES2DecoderImpl::BindAndApplyTextureParameters(
- TextureManager::TextureInfo* info) {
- glBindTexture(info->target(), info->service_id());
- glTexParameteri(info->target(), GL_TEXTURE_MIN_FILTER, info->min_filter());
- glTexParameteri(info->target(), GL_TEXTURE_MAG_FILTER, info->mag_filter());
- glTexParameteri(info->target(), GL_TEXTURE_WRAP_S, info->wrap_s());
- glTexParameteri(info->target(), GL_TEXTURE_WRAP_T, info->wrap_t());
-}
-
GLuint GLES2DecoderImpl::GetBackbufferServiceId() const {
return (offscreen_target_frame_buffer_.get()) ?
offscreen_target_frame_buffer_->id() :
@@ -9647,7 +9635,7 @@ void GLES2DecoderImpl::DoProduceTextureCHROMIUM(GLenum target,
return;
}
- BindAndApplyTextureParameters(info);
+ glBindTexture(info->target(), info->service_id());
}
void GLES2DecoderImpl::DoConsumeTextureCHROMIUM(GLenum target,
@@ -9675,7 +9663,7 @@ void GLES2DecoderImpl::DoConsumeTextureCHROMIUM(GLenum target,
return;
}
- BindAndApplyTextureParameters(info);
+ glBindTexture(info->target(), info->service_id());
}
void GLES2DecoderImpl::DoInsertEventMarkerEXT(
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
index b60c917..3962311 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
@@ -7259,26 +7259,13 @@ TEST_F(GLES2DecoderTest, ProduceAndConsumeTextureCHROMIUM) {
group().texture_manager()->GetTextureInfo(client_texture_id_);
EXPECT_EQ(kServiceTextureId, info->service_id());
- // Assigns and binds new service side texture ID and applies the texture
- // objects' state to it.
+ // Assigns and binds new service side texture ID.
EXPECT_CALL(*gl_, GenTextures(1, _))
.WillOnce(SetArgumentPointee<1>(kNewServiceId))
.RetiresOnSaturation();
EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kNewServiceId))
.Times(1)
.RetiresOnSaturation();
- EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D,
- GL_TEXTURE_MIN_FILTER,
- GL_NEAREST_MIPMAP_LINEAR));
- EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D,
- GL_TEXTURE_MAG_FILTER,
- GL_LINEAR));
- EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D,
- GL_TEXTURE_WRAP_S,
- GL_REPEAT));
- EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D,
- GL_TEXTURE_WRAP_T,
- GL_REPEAT));
ProduceTextureCHROMIUM produce_cmd;
produce_cmd.Init(GL_TEXTURE_2D, kSharedMemoryId, kSharedMemoryOffset);
@@ -7307,26 +7294,13 @@ TEST_F(GLES2DecoderTest, ProduceAndConsumeTextureCHROMIUM) {
// Service ID has changed.
EXPECT_EQ(kNewServiceId, info->service_id());
- // Assigns and binds original service side texture ID and applies the texture
- // objects' state to it.
+ // Assigns and binds original service size texture ID.
EXPECT_CALL(*gl_, DeleteTextures(1, _))
.Times(1)
.RetiresOnSaturation();
EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, kServiceTextureId))
.Times(1)
.RetiresOnSaturation();
- EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D,
- GL_TEXTURE_MIN_FILTER,
- GL_NEAREST_MIPMAP_LINEAR));
- EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D,
- GL_TEXTURE_MAG_FILTER,
- GL_LINEAR));
- EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D,
- GL_TEXTURE_WRAP_S,
- GL_REPEAT));
- EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_2D,
- GL_TEXTURE_WRAP_T,
- GL_REPEAT));
ConsumeTextureCHROMIUM consume_cmd;
consume_cmd.Init(GL_TEXTURE_2D, kSharedMemoryId, kSharedMemoryOffset);