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

Unified Diff: cc/trees/layer_tree_host_impl.h

Issue 1411663002: cc: Split Proxy to eliminate unnecessary dependencies on the impl side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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: cc/trees/layer_tree_host_impl.h
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h
index ed724b34548537d9d97cb6d68f9936929fef191c..92e13f6fded0cce6e60e82cb22b793b5d4c5dbc1 100644
--- a/cc/trees/layer_tree_host_impl.h
+++ b/cc/trees/layer_tree_host_impl.h
@@ -38,7 +38,7 @@
#include "cc/tiles/tile_manager.h"
#include "cc/trees/layer_tree_settings.h"
#include "cc/trees/mutator_host_client.h"
-#include "cc/trees/proxy.h"
+#include "cc/trees/thread_verifier.h"
#include "skia/ext/refptr.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/geometry/rect.h"
@@ -148,7 +148,7 @@ class CC_EXPORT LayerTreeHostImpl
static scoped_ptr<LayerTreeHostImpl> Create(
const LayerTreeSettings& settings,
LayerTreeHostImplClient* client,
- Proxy* proxy,
+ ThreadVerifier* thread_verifier,
RenderingStatsInstrumentation* rendering_stats_instrumentation,
SharedBitmapManager* shared_bitmap_manager,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
@@ -412,7 +412,7 @@ class CC_EXPORT LayerTreeHostImpl
// Returns the tree LTH synchronizes with.
LayerTreeImpl* sync_tree() {
// TODO(enne): This is bogus. It should return based on the value of
- // Proxy::CommitToActiveTree and not whether the pending tree exists.
+ // CommitToActiveTree() and not whether the pending tree exists.
return pending_tree_ ? pending_tree_.get() : active_tree_.get();
}
virtual void CreatePendingTree();
@@ -476,7 +476,7 @@ class CC_EXPORT LayerTreeHostImpl
return global_tile_state_;
}
- Proxy* proxy() const { return proxy_; }
+ ThreadVerifier* thread_verifier() const { return thread_verifier_; }
AnimationRegistrar* animation_registrar() const {
return animation_registrar_.get();
@@ -552,6 +552,9 @@ class CC_EXPORT LayerTreeHostImpl
// Only valid for synchronous (non-scheduled) single-threaded case.
void SynchronouslyInitializeAllTiles();
+ bool SupportsImplScrolling() const;
+ bool CommitToActiveTree() const;
+
virtual void CreateResourceAndTileTaskWorkerPool(
scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool,
scoped_ptr<ResourcePool>* resource_pool);
@@ -585,11 +588,18 @@ class CC_EXPORT LayerTreeHostImpl
scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events,
scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events);
+ base::SingleThreadTaskRunner* GetTaskRunner() const {
+ DCHECK(thread_verifier_);
+ return thread_verifier_->HasImplThread()
+ ? thread_verifier_->ImplThreadTaskRunner()
+ : thread_verifier_->MainThreadTaskRunner();
+ }
+
protected:
LayerTreeHostImpl(
const LayerTreeSettings& settings,
LayerTreeHostImplClient* client,
- Proxy* proxy,
+ ThreadVerifier* thread_verifier,
RenderingStatsInstrumentation* rendering_stats_instrumentation,
SharedBitmapManager* shared_bitmap_manager,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
@@ -607,7 +617,7 @@ class CC_EXPORT LayerTreeHostImpl
static void RemoveRenderPasses(FrameData* frame);
LayerTreeHostImplClient* client_;
- Proxy* proxy_;
+ ThreadVerifier* thread_verifier_;
BeginFrameTracker current_begin_frame_tracker_;
@@ -681,12 +691,6 @@ class CC_EXPORT LayerTreeHostImpl
bool ScrollAnimationUpdateTarget(LayerImpl* layer_impl,
const gfx::Vector2dF& scroll_delta);
- base::SingleThreadTaskRunner* GetTaskRunner() const {
- DCHECK(proxy_);
- return proxy_->HasImplThread() ? proxy_->ImplThreadTaskRunner()
- : proxy_->MainThreadTaskRunner();
- }
-
typedef base::hash_map<UIResourceId, UIResourceData>
UIResourceMap;
UIResourceMap ui_resource_map_;

Powered by Google App Engine
This is Rietveld 408576698