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

Unified Diff: ui/compositor/compositor.h

Issue 553213003: Avoid destroying surface before the parent surface stops referencing it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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.h
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index 541f19ddee4aa18685557d6e3ce5cfbc5cfae081..6167aabb6d0d4be5dfe680b54c55ed97b4a964f8 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -13,6 +13,7 @@
#include "base/observer_list.h"
#include "base/single_thread_task_runner.h"
#include "base/time/time.h"
+#include "cc/surfaces/surface_sequence.h"
#include "cc/trees/layer_tree_host_client.h"
#include "cc/trees/layer_tree_host_single_thread_client.h"
#include "third_party/skia/include/core/SkColor.h"
@@ -37,6 +38,7 @@ class Layer;
class LayerTreeDebugState;
class LayerTreeHost;
class SharedBitmapManager;
+class SurfaceIdAllocator;
}
namespace gfx {
@@ -95,6 +97,9 @@ class COMPOSITOR_EXPORT ContextFactory {
// Gets the compositor message loop, or NULL if not using threaded
// compositing.
virtual base::MessageLoopProxy* GetCompositorMessageLoop() = 0;
+
+ // Creates a Surface ID allocator with a new namespace.
+ virtual scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() = 0;
};
// This class represents a lock on the compositor, that can be used to prevent
@@ -266,6 +271,14 @@ class COMPOSITOR_EXPORT Compositor
return &layer_animator_collection_;
}
+ // Creates a SurfaceSequence that will be satisfied on the next frame this
+ // compositor commits and swaps.
+ cc::SurfaceSequence CreateSurfaceSequenceForNextFrame();
+
+ cc::SurfaceIdAllocator* surface_id_allocator() {
+ return surface_id_allocator_.get();
+ }
+
private:
friend class base::RefCounted<Compositor>;
friend class CompositorLock;
@@ -290,6 +303,8 @@ class COMPOSITOR_EXPORT Compositor
ObserverList<CompositorAnimationObserver> animation_observer_list_;
gfx::AcceleratedWidget widget_;
+ scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_;
+ uint32_t surface_sequence_number_;
scoped_refptr<cc::Layer> root_web_layer_;
scoped_ptr<cc::LayerTreeHost> host_;
scoped_refptr<base::MessageLoopProxy> compositor_thread_loop_;

Powered by Google App Engine
This is Rietveld 408576698