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

Side by Side Diff: cc/trees/single_thread_proxy.h

Issue 19106007: cc: Allow the main thread to cancel commits (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_TREES_SINGLE_THREAD_PROXY_H_ 5 #ifndef CC_TREES_SINGLE_THREAD_PROXY_H_
6 #define CC_TREES_SINGLE_THREAD_PROXY_H_ 6 #define CC_TREES_SINGLE_THREAD_PROXY_H_
7 7
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 14 matching lines...) Expand all
25 25
26 // Proxy implementation 26 // Proxy implementation
27 virtual bool CompositeAndReadback(void* pixels, gfx::Rect rect) OVERRIDE; 27 virtual bool CompositeAndReadback(void* pixels, gfx::Rect rect) OVERRIDE;
28 virtual void FinishAllRendering() OVERRIDE; 28 virtual void FinishAllRendering() OVERRIDE;
29 virtual bool IsStarted() const OVERRIDE; 29 virtual bool IsStarted() const OVERRIDE;
30 virtual void SetLayerTreeHostClientReady() OVERRIDE; 30 virtual void SetLayerTreeHostClientReady() OVERRIDE;
31 virtual void SetVisible(bool visible) OVERRIDE; 31 virtual void SetVisible(bool visible) OVERRIDE;
32 virtual void CreateAndInitializeOutputSurface() OVERRIDE; 32 virtual void CreateAndInitializeOutputSurface() OVERRIDE;
33 virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE; 33 virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE;
34 virtual void SetNeedsAnimate() OVERRIDE; 34 virtual void SetNeedsAnimate() OVERRIDE;
35 virtual void SetNeedsUpdateLayers() OVERRIDE;
35 virtual void SetNeedsCommit() OVERRIDE; 36 virtual void SetNeedsCommit() OVERRIDE;
36 virtual void SetNeedsRedraw(gfx::Rect damage_rect) OVERRIDE; 37 virtual void SetNeedsRedraw(gfx::Rect damage_rect) OVERRIDE;
37 virtual void SetDeferCommits(bool defer_commits) OVERRIDE; 38 virtual void SetDeferCommits(bool defer_commits) OVERRIDE;
38 virtual bool CommitRequested() const OVERRIDE; 39 virtual bool CommitRequested() const OVERRIDE;
39 virtual void MainThreadHasStoppedFlinging() OVERRIDE {} 40 virtual void MainThreadHasStoppedFlinging() OVERRIDE {}
40 virtual void Start(scoped_ptr<OutputSurface> first_output_surface) OVERRIDE; 41 virtual void Start(scoped_ptr<OutputSurface> first_output_surface) OVERRIDE;
41 virtual void Stop() OVERRIDE; 42 virtual void Stop() OVERRIDE;
42 virtual size_t MaxPartialTextureUpdates() const OVERRIDE; 43 virtual size_t MaxPartialTextureUpdates() const OVERRIDE;
43 virtual void AcquireLayerTextures() OVERRIDE {} 44 virtual void AcquireLayerTextures() OVERRIDE {}
44 virtual void ForceSerializeOnSwapBuffers() OVERRIDE; 45 virtual void ForceSerializeOnSwapBuffers() OVERRIDE;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 107
107 // Used on the Thread, but checked on main thread during 108 // Used on the Thread, but checked on main thread during
108 // initialization/shutdown. 109 // initialization/shutdown.
109 scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl_; 110 scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl_;
110 RendererCapabilities renderer_capabilities_for_main_thread_; 111 RendererCapabilities renderer_capabilities_for_main_thread_;
111 112
112 bool next_frame_is_newly_committed_frame_; 113 bool next_frame_is_newly_committed_frame_;
113 114
114 bool inside_draw_; 115 bool inside_draw_;
115 116
117 bool can_cancel_commit_;
118
116 DISALLOW_COPY_AND_ASSIGN(SingleThreadProxy); 119 DISALLOW_COPY_AND_ASSIGN(SingleThreadProxy);
117 }; 120 };
118 121
119 // For use in the single-threaded case. In debug builds, it pretends that the 122 // For use in the single-threaded case. In debug builds, it pretends that the
120 // code is running on the impl thread to satisfy assertion checks. 123 // code is running on the impl thread to satisfy assertion checks.
121 class DebugScopedSetImplThread { 124 class DebugScopedSetImplThread {
122 public: 125 public:
123 explicit DebugScopedSetImplThread(Proxy* proxy) : proxy_(proxy) { 126 explicit DebugScopedSetImplThread(Proxy* proxy) : proxy_(proxy) {
124 #ifndef NDEBUG 127 #ifndef NDEBUG
125 previous_value_ = proxy_->impl_thread_is_overridden_; 128 previous_value_ = proxy_->impl_thread_is_overridden_;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 private: 176 private:
174 DebugScopedSetImplThread impl_thread_; 177 DebugScopedSetImplThread impl_thread_;
175 DebugScopedSetMainThreadBlocked main_thread_blocked_; 178 DebugScopedSetMainThreadBlocked main_thread_blocked_;
176 179
177 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetImplThreadAndMainThreadBlocked); 180 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetImplThreadAndMainThreadBlocked);
178 }; 181 };
179 182
180 } // namespace cc 183 } // namespace cc
181 184
182 #endif // CC_TREES_SINGLE_THREAD_PROXY_H_ 185 #endif // CC_TREES_SINGLE_THREAD_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698