diff options
author | sheu@chromium.org <sheu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-03 23:39:50 +0000 |
---|---|---|
committer | sheu@chromium.org <sheu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-03 23:39:50 +0000 |
commit | df41e253e6918cd035c36936761734f2ac694466 (patch) | |
tree | 9f92ab76398898bbd0f880d821e39a433018526c /webkit | |
parent | 3a48972e78af233d570818d21f426afa8c51c2ff (diff) | |
download | chromium_src-df41e253e6918cd035c36936761734f2ac694466.zip chromium_src-df41e253e6918cd035c36936761734f2ac694466.tar.gz chromium_src-df41e253e6918cd035c36936761734f2ac694466.tar.bz2 |
Add gpu::MailboxHolder to hold state for a gpu::Mailbox
gpu::Mailbox by itself can hold only a texture id, but in common usage it comes
with texture target and syncpoint information for cross-context sharing. To
reduce repetition of this pattern, gpu::MailboxHolder holds:
* a gpu::Mailbox
* a GL texture target
* a syncpoint index
Refactor other classes to use a gpu::MailboxHolder instead of separate
gpu::Mailbox and associated state.
Syncpoints are created with uint32 indices; make sure all uses of syncpoints
use the appropriate type.
BUG=None
TEST=local build, unittests on CrOS snow, desktop Linux
TBR=piman@chromium.org, enn@chromium.orge, cevans@chromium.org, scherkus@chromium.org
Review URL: https://codereview.chromium.org/132233041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248612 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/renderer/compositor_bindings/web_external_texture_layer_impl.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/webkit/renderer/compositor_bindings/web_external_texture_layer_impl.cc b/webkit/renderer/compositor_bindings/web_external_texture_layer_impl.cc index e5a33d5f..8657b38 100644 --- a/webkit/renderer/compositor_bindings/web_external_texture_layer_impl.cc +++ b/webkit/renderer/compositor_bindings/web_external_texture_layer_impl.cc @@ -13,6 +13,7 @@ #include "third_party/WebKit/public/platform/WebFloatRect.h" #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" #include "third_party/WebKit/public/platform/WebSize.h" +#include "third_party/khronos/GLES2/gl2.h" #include "webkit/renderer/compositor_bindings/web_external_bitmap_impl.h" #include "webkit/renderer/compositor_bindings/web_layer_impl.h" @@ -82,10 +83,12 @@ bool WebExternalTextureLayerImpl::PrepareTextureMailbox( } gpu::Mailbox name; name.SetName(client_mailbox.name); - if (bitmap) + if (bitmap) { *mailbox = cc::TextureMailbox(bitmap->shared_memory(), bitmap->size()); - else - *mailbox = cc::TextureMailbox(name, client_mailbox.syncPoint); + } else { + *mailbox = + cc::TextureMailbox(name, GL_TEXTURE_2D, client_mailbox.syncPoint); + } if (mailbox->IsValid()) { *release_callback = cc::SingleReleaseCallback::Create(base::Bind( |