From e3ba66cd5a854a9af7282d5bf425059a1044bf89 Mon Sep 17 00:00:00 2001 From: "sky@chromium.org" Date: Fri, 7 Dec 2012 01:03:21 +0000 Subject: Revert 171569 as it broke some browser_tests on win_aura. > Implement TextureImageTransportSurface using texture mailbox > > This has a couple of advantages: > - allow tearing down and recreating the UI parent context without > losing the renderer contexts > - do not require a context to be able to generate textures when > creating the GLSurfaceHandle > - clearer ownership semantics that potentially allows for more > robust and easier lost context handling/thumbnailing/etc., since a texture is at > any given time owned by either: UI parent, mailbox, or > TextureImageTransportSurface > - simplify frontbuffer protection logic; > the frontbuffer textures are now owned by RWHV where they are refcounted > > The TextureImageTransportSurface informs RenderWidgetHostView of the > mailbox names for the front- and backbuffer textures by > associating them with a surface_handle (1 or 2) in the AcceleratedSurfaceNew message. > During SwapBuffers() or PostSubBuffer() cycles, it then uses > produceTextureCHROMIUM() and consumeTextureCHROMIUM() > to transfer ownership between renderer and browser compositor. > > RWHV sends back the surface_handle of the buffer being returned with the Swap ACK > (or 0 if no buffer is being returned in which case TextureImageTransportSurface will > allocate a new texture - note that this could be used to > simply keep textures for thumbnailing). > > BUG=154815,139616 > TBR=sky@chromium.org > > Review URL: https://chromiumcodereview.appspot.com/11194042 Here's sample output: [7748:4224:1206/162608:3511660:FATAL:prioritized_resource_manager.cc(316)] Check failed: resourceProvider. Backtrace: base::debug::StackTrace::StackTrace [0x72279581+33] (c:\b\build\slave\win_aura\build\src\base\debug\stack_trace_win.cc:171) logging::LogMessage::~LogMessage [0x721603CE+94] (c:\b\build\slave\win_aura\build\src\base\logging.cc:564) cc::PrioritizedResourceManager::clearAllMemory [0x66C0833F+479] (c:\b\build\slave\win_aura\build\src\cc\prioritized_resource_manager.cc:316) cc::LayerTreeHost::deleteContentsTexturesOnImplThread [0x66B1B8E2+322] (c:\b\build\slave\win_aura\build\src\cc\layer_tree_host.cc:314) cc::SingleThreadProxy::recreateOutputSurface [0x66AF7F00+848] (c:\b\build\slave\win_aura\build\src\cc\single_thread_proxy.cc:138) cc::LayerTreeHost::recreateOutputSurface [0x66B1B50B+475] (c:\b\build\slave\win_aura\build\src\cc\layer_tree_host.cc:281) cc::LayerTreeHost::initializeRendererIfNeeded [0x66B1E5FC+76] (c:\b\build\slave\win_aura\build\src\cc\layer_tree_host.cc:631) cc::SingleThreadProxy::commitAndComposite [0x66AFA4CC+284] (c:\b\build\slave\win_aura\build\src\cc\single_thread_proxy.cc:342) cc::SingleThreadProxy::compositeImmediately [0x66AFA0E6+22] (c:\b\build\slave\win_aura\build\src\cc\single_thread_proxy.cc:318) cc::LayerTreeHost::composite [0x66B1E51A+58] (c:\b\build\slave\win_aura\build\src\cc\layer_tree_host.cc:613) ui::Compositor::Draw [0x6E680DAF+383] (c:\b\build\slave\win_aura\build\src\ui\compositor\compositor.cc:397) aura::RootWindow::Draw [0x6B96E2AD+285] (c:\b\build\slave\win_aura\build\src\ui\aura\root_window.cc:244) base::internal::RunnableAdapter::Run [0x6B978DA1+33] (c:\b\build\slave\win_aura\build\src\base\bind_internal.h:134) base::internal::InvokeHelper<1,void,base::internal::RunnableAdapter,void __cdecl(base::WeakPtr const &)>::MakeItSo [0x6B978CBD+45] (c:\b\build\slave\win_aura\build\src\base\bind_internal.h:884) base::internal::Invoker<1,base::internal::BindState,void __cdecl(aura::RootWindow *),void from http://build.chromium.org/p/chromium.win/builders/Win%20Aura/builds/24952/steps/browser_tests/logs/WebGLAllowed TBR=sievers@chromium.org Review URL: https://codereview.chromium.org/11475017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171663 0039d316-1c4b-4281-b951-d872f2087c98 --- gpu/command_buffer/service/mailbox_manager.cc | 13 +++---------- gpu/command_buffer/service/mailbox_manager.h | 3 +-- gpu/command_buffer/service/texture_definition.cc | 12 ------------ gpu/command_buffer/service/texture_definition.h | 4 +--- 4 files changed, 5 insertions(+), 27 deletions(-) (limited to 'gpu') diff --git a/gpu/command_buffer/service/mailbox_manager.cc b/gpu/command_buffer/service/mailbox_manager.cc index 9019393..ec7ad94 100644 --- a/gpu/command_buffer/service/mailbox_manager.cc +++ b/gpu/command_buffer/service/mailbox_manager.cc @@ -4,8 +4,6 @@ #include "gpu/command_buffer/service/mailbox_manager.h" -#include - #include "base/rand_util.h" #include "crypto/hmac.h" #include "gpu/command_buffer/service/gl_utils.h" @@ -14,11 +12,6 @@ namespace gpu { namespace gles2 { -MailboxName::MailboxName() { - std::fill(key, key + sizeof(key), 0); - std::fill(signature, signature + sizeof(signature), 0); -} - MailboxManager::MailboxManager() : hmac_(crypto::HMAC::SHA256), textures_(std::ptr_fun(&MailboxManager::TargetNameLess)) { @@ -26,11 +19,9 @@ MailboxManager::MailboxManager() bool success = hmac_.Init( base::StringPiece(private_key_, sizeof(private_key_))); DCHECK(success); - DCHECK(!IsMailboxNameValid(MailboxName())); } MailboxManager::~MailboxManager() { - DCHECK(!textures_.size()); } void MailboxManager::GenerateMailboxName(MailboxName* name) { @@ -45,8 +36,10 @@ TextureDefinition* MailboxManager::ConsumeTexture(unsigned target, TextureDefinitionMap::iterator it = textures_.find(TargetName(target, name)); - if (it == textures_.end()) + if (it == textures_.end()) { + NOTREACHED(); return NULL; + } TextureDefinition* definition = it->second.definition.release(); textures_.erase(it); diff --git a/gpu/command_buffer/service/mailbox_manager.h b/gpu/command_buffer/service/mailbox_manager.h index 8f97dd4..337998d 100644 --- a/gpu/command_buffer/service/mailbox_manager.h +++ b/gpu/command_buffer/service/mailbox_manager.h @@ -30,8 +30,7 @@ class TextureManager; // Identifies a mailbox where a texture definition can be stored for // transferring textures between contexts that are not in the same context // group. It is a random key signed with a hash of a private key. -struct GPU_EXPORT MailboxName { - MailboxName(); +struct MailboxName { GLbyte key[GL_MAILBOX_SIZE_CHROMIUM / 2]; GLbyte signature[GL_MAILBOX_SIZE_CHROMIUM / 2]; }; diff --git a/gpu/command_buffer/service/texture_definition.cc b/gpu/command_buffer/service/texture_definition.cc index e1c606f..aba0dfa 100644 --- a/gpu/command_buffer/service/texture_definition.cc +++ b/gpu/command_buffer/service/texture_definition.cc @@ -27,18 +27,6 @@ TextureDefinition::LevelInfo::LevelInfo(GLenum target, cleared(cleared) { } -TextureDefinition::LevelInfo::LevelInfo() - : target(0), - internal_format(0), - width(0), - height(0), - depth(0), - border(0), - format(0), - type(0), - cleared(true) { -} - TextureDefinition::TextureDefinition(GLenum target, GLuint service_id, GLenum min_filter, diff --git a/gpu/command_buffer/service/texture_definition.h b/gpu/command_buffer/service/texture_definition.h index 7f7d3cd..0a9910b 100644 --- a/gpu/command_buffer/service/texture_definition.h +++ b/gpu/command_buffer/service/texture_definition.h @@ -19,7 +19,7 @@ namespace gles2 { // context using the same GLShareGroup with the corresponding service ID. class GPU_EXPORT TextureDefinition { public: - struct GPU_EXPORT LevelInfo { + struct LevelInfo { LevelInfo(GLenum target, GLenum internal_format, GLsizei width, @@ -29,8 +29,6 @@ class GPU_EXPORT TextureDefinition { GLenum format, GLenum type, bool cleared); - LevelInfo(); - GLenum target; GLenum internal_format; GLsizei width; -- cgit v1.1