summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-07 01:03:21 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-07 01:03:21 +0000
commite3ba66cd5a854a9af7282d5bf425059a1044bf89 (patch)
treedceb529b5e5f818c66f914eab72cb17db2c1cff0 /ui
parent1cdbf14f38a2fce8d27a71dffeeef9f88a508028 (diff)
downloadchromium_src-e3ba66cd5a854a9af7282d5bf425059a1044bf89.zip
chromium_src-e3ba66cd5a854a9af7282d5bf425059a1044bf89.tar.gz
chromium_src-e3ba66cd5a854a9af7282d5bf425059a1044bf89.tar.bz2
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<void (__thiscall aura::RootWindow::*)(void)>::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 (__thiscall aura::RootWindow::*)(void)>,void __cdecl(base::WeakPtr<aura::RootWindow> const &)>::MakeItSo [0x6B978CBD+45] (c:\b\build\slave\win_aura\build\src\base\bind_internal.h:884) base::internal::Invoker<1,base::internal::BindState<base::internal::RunnableAdapter<void (__thiscall aura::RootWindow::*)(void)>,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
Diffstat (limited to 'ui')
-rw-r--r--ui/compositor/compositor.cc4
-rw-r--r--ui/compositor/compositor.h5
-rw-r--r--ui/gfx/native_widget_types.h15
3 files changed, 16 insertions, 8 deletions
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index d6c6a79..14f6a1b 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -192,8 +192,8 @@ WebKit::WebGraphicsContext3D* DefaultContextFactory::CreateContextCommon(
}
Texture::Texture(bool flipped, const gfx::Size& size, float device_scale_factor)
- : size_(size),
- flipped_(flipped),
+ : flipped_(flipped),
+ size_(size),
device_scale_factor_(device_scale_factor) {
}
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index 3dbebd2..0e2445f 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -112,17 +112,14 @@ class COMPOSITOR_EXPORT Texture : public base::RefCounted<Texture> {
virtual unsigned int PrepareTexture() = 0;
virtual WebKit::WebGraphicsContext3D* HostContext3D() = 0;
- virtual void Consume(const gfx::Size& new_size) {}
- virtual void Produce() {}
-
protected:
virtual ~Texture();
- gfx::Size size_; // in pixel
private:
friend class base::RefCounted<Texture>;
bool flipped_;
+ gfx::Size size_; // in pixel
float device_scale_factor_;
DISALLOW_COPY_AND_ASSIGN(Texture);
diff --git a/ui/gfx/native_widget_types.h b/ui/gfx/native_widget_types.h
index 22a6756..6dbc4e7 100644
--- a/ui/gfx/native_widget_types.h
+++ b/ui/gfx/native_widget_types.h
@@ -278,19 +278,30 @@ struct GLSurfaceHandle {
: handle(kNullPluginWindow),
transport(false),
parent_gpu_process_id(0),
- parent_client_id(0) {
+ parent_client_id(0),
+ parent_context_id(0),
+ sync_point(0) {
+ parent_texture_id[0] = 0;
+ parent_texture_id[1] = 0;
}
GLSurfaceHandle(PluginWindowHandle handle_, bool transport_)
: handle(handle_),
transport(transport_),
parent_gpu_process_id(0),
- parent_client_id(0) {
+ parent_client_id(0),
+ parent_context_id(0),
+ sync_point(0) {
+ parent_texture_id[0] = 0;
+ parent_texture_id[1] = 0;
}
bool is_null() const { return handle == kNullPluginWindow && !transport; }
PluginWindowHandle handle;
bool transport;
int parent_gpu_process_id;
uint32 parent_client_id;
+ uint32 parent_context_id;
+ uint32 parent_texture_id[2];
+ uint32 sync_point;
};
// AcceleratedWidget provides a surface to compositors to paint pixels.