Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: ui/compositor/compositor.cc

Issue 10689108: Aura: Have ui::Layer implement WebKit::WebExternalTextureLayerClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable the test compositor instead. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/compositor/compositor.cc
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index 148a5bd28c782ebc0a5ebac6fa65742d4d092717..4eaf4c663a89e9942e90062f9f7fe33e4a7fa8f3 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -162,6 +162,9 @@ Compositor::Compositor(CompositorDelegate* delegate,
}
Compositor::~Compositor() {
+ // Clear out any pending callbacks.
+ didCommit();
piman 2012/07/12 17:42:27 Is this still needed? I figure by the time we get
jonathan.backer 2012/07/13 13:26:24 You're right. There's nothing special. We'll leave
+
// Don't call |CompositorDelegate::ScheduleDraw| from this point.
delegate_ = NULL;
// There's a cycle between |root_web_layer_| and |host_|, which results in
@@ -170,6 +173,11 @@ Compositor::~Compositor() {
host_.setRootLayer(NULL);
if (root_layer_)
root_layer_->SetCompositor(NULL);
+
+ // Stop all outstanding draws before telling the ContextFactory to tear
+ // down any contexts that the |host_| may rely upon.
+ host_.reset();
+
if (!test_compositor_enabled)
ContextFactory::GetInstance()->RemoveCompositor(this);
}
@@ -292,6 +300,10 @@ bool Compositor::HasObserver(CompositorObserver* observer) {
return observer_list_.HasObserver(observer);
}
+bool Compositor::IsThreaded() const {
+ return g_compositor_thread != NULL;
+}
+
void Compositor::OnSwapBuffersPosted() {
swap_posted_ = true;
}
@@ -342,6 +354,14 @@ WebKit::WebGraphicsContext3D* Compositor::createContext3D() {
void Compositor::didRebindGraphicsContext(bool success) {
}
+// Called once per draw in single-threaded compositor mode and potentially
+// many times between draws in the multi-threaded compositor mode.
+void Compositor::didCommit() {
+ FOR_EACH_OBSERVER(CompositorObserver,
+ observer_list_,
+ OnCompositingDidCommit(this));
+}
+
void Compositor::didCommitAndDrawFrame() {
// TODO(backer): Plumb through an earlier impl side will start.
if (g_compositor_thread)

Powered by Google App Engine
This is Rietveld 408576698