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

Side by Side Diff: cc/thread_proxy.cc

Issue 11232051: Remove static thread pointers from CC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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 unified diff | Download patch
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 #include "config.h" 5 #include "config.h"
6 6
7 #include "cc/thread_proxy.h" 7 #include "cc/thread_proxy.h"
8 8
9 #include "CCDelayBasedTimeSource.h" 9 #include "CCDelayBasedTimeSource.h"
10 #include "CCDrawQuad.h" 10 #include "CCDrawQuad.h"
(...skipping 12 matching lines...) Expand all
23 23
24 namespace { 24 namespace {
25 25
26 // Measured in seconds. 26 // Measured in seconds.
27 const double contextRecreationTickRate = 0.03; 27 const double contextRecreationTickRate = 0.03;
28 28
29 } // namespace 29 } // namespace
30 30
31 namespace cc { 31 namespace cc {
32 32
33 scoped_ptr<CCProxy> CCThreadProxy::create(CCLayerTreeHost* layerTreeHost) 33 scoped_ptr<CCProxy> CCThreadProxy::create(CCLayerTreeHost* layerTreeHost, WebThr ead* compositorThread)
34 { 34 {
35 return make_scoped_ptr(new CCThreadProxy(layerTreeHost)).PassAs<CCProxy>(); 35 return make_scoped_ptr(new CCThreadProxy(layerTreeHost, compositorThread)).P assAs<CCProxy>();
36 } 36 }
37 37
38 CCThreadProxy::CCThreadProxy(CCLayerTreeHost* layerTreeHost) 38 CCThreadProxy::CCThreadProxy(CCLayerTreeHost* layerTreeHost, CompositorSupportSt ate* compositorSupportState)
39 : m_animateRequested(false) 39 : CCProxy(compositorSupportState)
40 , m_animateRequested(false)
40 , m_commitRequested(false) 41 , m_commitRequested(false)
41 , m_commitRequestSentToImplThread(false) 42 , m_commitRequestSentToImplThread(false)
42 , m_forcedCommitRequested(false) 43 , m_forcedCommitRequested(false)
43 , m_layerTreeHost(layerTreeHost) 44 , m_layerTreeHost(layerTreeHost)
44 , m_rendererInitialized(false) 45 , m_rendererInitialized(false)
45 , m_started(false) 46 , m_started(false)
46 , m_texturesAcquired(true) 47 , m_texturesAcquired(true)
47 , m_inCompositeAndReadback(false) 48 , m_inCompositeAndReadback(false)
48 , m_mainThreadProxy(CCScopedThreadProxy::create(CCProxy::mainThread())) 49 , m_mainThreadProxy(CCScopedThreadProxy::create(CCProxy::mainThread()))
49 , m_beginFrameCompletionEventOnImplThread(0) 50 , m_beginFrameCompletionEventOnImplThread(0)
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 public: 825 public:
825 static scoped_ptr<CCThreadProxyContextRecreationTimer> create(CCThreadProxy* proxy) { return make_scoped_ptr(new CCThreadProxyContextRecreationTimer(proxy)) ; } 826 static scoped_ptr<CCThreadProxyContextRecreationTimer> create(CCThreadProxy* proxy) { return make_scoped_ptr(new CCThreadProxyContextRecreationTimer(proxy)) ; }
826 827
827 virtual void onTimerFired() OVERRIDE 828 virtual void onTimerFired() OVERRIDE
828 { 829 {
829 m_proxy->tryToRecreateContext(); 830 m_proxy->tryToRecreateContext();
830 } 831 }
831 832
832 private: 833 private:
833 explicit CCThreadProxyContextRecreationTimer(CCThreadProxy* proxy) 834 explicit CCThreadProxyContextRecreationTimer(CCThreadProxy* proxy)
834 : CCTimer(CCProxy::mainThread(), this) 835 : CCTimer(proxy->mainThread(), this)
835 , m_proxy(proxy) 836 , m_proxy(proxy)
836 { 837 {
837 } 838 }
838 839
839 CCThreadProxy* m_proxy; 840 CCThreadProxy* m_proxy;
840 }; 841 };
841 842
842 void CCThreadProxy::beginContextRecreation() 843 void CCThreadProxy::beginContextRecreation()
843 { 844 {
844 TRACE_EVENT0("cc", "CCThreadProxy::beginContextRecreation"); 845 TRACE_EVENT0("cc", "CCThreadProxy::beginContextRecreation");
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 CCThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState() 949 CCThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState()
949 : monotonicFrameBeginTime(0) 950 : monotonicFrameBeginTime(0)
950 { 951 {
951 } 952 }
952 953
953 CCThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState() 954 CCThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState()
954 { 955 {
955 } 956 }
956 957
957 } // namespace cc 958 } // namespace cc
OLDNEW
« cc/proxy.h ('K') | « cc/thread_proxy.h ('k') | cc/video_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698