diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-08 14:02:18 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-08 14:02:18 +0000 |
commit | 60f8578a028b35dca89701065b078d7ce45565c0 (patch) | |
tree | efe86d8302f1256713e3fe2d6d1fff68e7aa4825 /cc | |
parent | f76c33faf39e43e994b3c59d21d5e7421dcde554 (diff) | |
download | chromium_src-60f8578a028b35dca89701065b078d7ce45565c0.zip chromium_src-60f8578a028b35dca89701065b078d7ce45565c0.tar.gz chromium_src-60f8578a028b35dca89701065b078d7ce45565c0.tar.bz2 |
cc: Chromify cc::Proxy style
R=danakj@chromium.org
BUG=none
Review URL: https://chromiumcodereview.appspot.com/12547017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186954 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/layer_tree_host.cc | 86 | ||||
-rw-r--r-- | cc/layer_tree_host_impl.cc | 20 | ||||
-rw-r--r-- | cc/layer_tree_host_unittest.cc | 14 | ||||
-rw-r--r-- | cc/layer_tree_host_unittest_context.cc | 8 | ||||
-rw-r--r-- | cc/prioritized_resource.cc | 10 | ||||
-rw-r--r-- | cc/prioritized_resource_manager.cc | 46 | ||||
-rw-r--r-- | cc/proxy.cc | 90 | ||||
-rw-r--r-- | cc/proxy.h | 165 | ||||
-rw-r--r-- | cc/resource_update_controller_unittest.cc | 2 | ||||
-rw-r--r-- | cc/single_thread_proxy.cc | 84 | ||||
-rw-r--r-- | cc/single_thread_proxy.h | 76 | ||||
-rw-r--r-- | cc/test/fake_proxy.cc | 24 | ||||
-rw-r--r-- | cc/test/fake_proxy.h | 54 | ||||
-rw-r--r-- | cc/test/layer_tree_test_common.cc | 34 | ||||
-rw-r--r-- | cc/test/layer_tree_test_common.h | 2 | ||||
-rw-r--r-- | cc/texture_layer.cc | 2 | ||||
-rw-r--r-- | cc/texture_layer_unittest.cc | 2 | ||||
-rw-r--r-- | cc/thread_proxy.cc | 248 | ||||
-rw-r--r-- | cc/thread_proxy.h | 52 | ||||
-rw-r--r-- | cc/tiled_layer_unittest.cc | 2 | ||||
-rw-r--r-- | cc/video_layer_impl.cc | 8 |
21 files changed, 509 insertions, 520 deletions
diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc index 3c6ead4..76294725 100644 --- a/cc/layer_tree_host.cc +++ b/cc/layer_tree_host.cc @@ -114,8 +114,8 @@ bool LayerTreeHost::initializeProxy(scoped_ptr<Proxy> proxy) TRACE_EVENT0("cc", "LayerTreeHost::initializeForReal"); m_proxy = proxy.Pass(); - m_proxy->start(); - return m_proxy->initializeOutputSurface(); + m_proxy->Start(); + return m_proxy->InitializeOutputSurface(); } LayerTreeHost::~LayerTreeHost() @@ -123,9 +123,9 @@ LayerTreeHost::~LayerTreeHost() if (m_rootLayer) m_rootLayer->setLayerTreeHost(0); DCHECK(m_proxy); - DCHECK(m_proxy->isMainThread()); + DCHECK(m_proxy->IsMainThread()); TRACE_EVENT0("cc", "LayerTreeHost::~LayerTreeHost"); - m_proxy->stop(); + m_proxy->Stop(); numLayerTreeInstances--; RateLimiterMap::iterator it = m_rateLimiters.begin(); if (it != m_rateLimiters.end()) @@ -141,25 +141,25 @@ LayerTreeHost::~LayerTreeHost() void LayerTreeHost::setSurfaceReady() { - m_proxy->setSurfaceReady(); + m_proxy->SetSurfaceReady(); } void LayerTreeHost::initializeRenderer() { TRACE_EVENT0("cc", "LayerTreeHost::initializeRenderer"); - if (!m_proxy->initializeRenderer()) { + if (!m_proxy->InitializeRenderer()) { // Uh oh, better tell the client that we can't do anything with this output surface. m_client->didRecreateOutputSurface(false); return; } // Update m_settings based on capabilities that we got back from the renderer. - m_settings.acceleratePainting = m_proxy->rendererCapabilities().usingAcceleratedPainting; + m_settings.acceleratePainting = m_proxy->GetRendererCapabilities().usingAcceleratedPainting; // Update m_settings based on partial update capability. size_t maxPartialTextureUpdates = 0; - if (m_proxy->rendererCapabilities().allowPartialTextureUpdates && !m_settings.implSidePainting) - maxPartialTextureUpdates = std::min(m_settings.maxPartialTextureUpdates, m_proxy->maxPartialTextureUpdates()); + if (m_proxy->GetRendererCapabilities().allowPartialTextureUpdates && !m_settings.implSidePainting) + maxPartialTextureUpdates = std::min(m_settings.maxPartialTextureUpdates, m_proxy->MaxPartialTextureUpdates()); m_settings.maxPartialTextureUpdates = maxPartialTextureUpdates; m_contentsTextureManager = PrioritizedResourceManager::create(m_proxy.get()); @@ -167,10 +167,10 @@ void LayerTreeHost::initializeRenderer() m_rendererInitialized = true; - m_settings.defaultTileSize = gfx::Size(std::min(m_settings.defaultTileSize.width(), m_proxy->rendererCapabilities().maxTextureSize), - std::min(m_settings.defaultTileSize.height(), m_proxy->rendererCapabilities().maxTextureSize)); - m_settings.maxUntiledLayerSize = gfx::Size(std::min(m_settings.maxUntiledLayerSize.width(), m_proxy->rendererCapabilities().maxTextureSize), - std::min(m_settings.maxUntiledLayerSize.height(), m_proxy->rendererCapabilities().maxTextureSize)); + m_settings.defaultTileSize = gfx::Size(std::min(m_settings.defaultTileSize.width(), m_proxy->GetRendererCapabilities().maxTextureSize), + std::min(m_settings.defaultTileSize.height(), m_proxy->GetRendererCapabilities().maxTextureSize)); + m_settings.maxUntiledLayerSize = gfx::Size(std::min(m_settings.maxUntiledLayerSize.width(), m_proxy->GetRendererCapabilities().maxTextureSize), + std::min(m_settings.maxUntiledLayerSize.height(), m_proxy->GetRendererCapabilities().maxTextureSize)); } LayerTreeHost::RecreateResult LayerTreeHost::recreateOutputSurface() @@ -178,7 +178,7 @@ LayerTreeHost::RecreateResult LayerTreeHost::recreateOutputSurface() TRACE_EVENT0("cc", "LayerTreeHost::recreateOutputSurface"); DCHECK(m_outputSurfaceLost); - if (m_proxy->recreateOutputSurface()) { + if (m_proxy->RecreateOutputSurface()) { m_client->didRecreateOutputSurface(true); m_outputSurfaceLost = false; return RecreateSucceeded; @@ -193,7 +193,7 @@ LayerTreeHost::RecreateResult LayerTreeHost::recreateOutputSurface() // FIXME: The single thread does not self-schedule output surface // recreation. So force another recreation attempt to happen by requesting // another commit. - if (!m_proxy->hasImplThread()) + if (!m_proxy->HasImplThread()) setNeedsCommit(); return RecreateFailedButTryAgain; } @@ -206,15 +206,15 @@ LayerTreeHost::RecreateResult LayerTreeHost::recreateOutputSurface() void LayerTreeHost::deleteContentsTexturesOnImplThread(ResourceProvider* resourceProvider) { - DCHECK(m_proxy->isImplThread()); + DCHECK(m_proxy->IsImplThread()); if (m_rendererInitialized) m_contentsTextureManager->clearAllMemory(resourceProvider); } void LayerTreeHost::acquireLayerTextures() { - DCHECK(m_proxy->isMainThread()); - m_proxy->acquireLayerTextures(); + DCHECK(m_proxy->IsMainThread()); + m_proxy->AcquireLayerTextures(); } void LayerTreeHost::didBeginFrame() @@ -234,7 +234,7 @@ void LayerTreeHost::updateAnimations(base::TimeTicks frameBeginTime) void LayerTreeHost::didStopFlinging() { - m_proxy->mainThreadHasStoppedFlinging(); + m_proxy->MainThreadHasStoppedFlinging(); } void LayerTreeHost::layout() @@ -244,7 +244,7 @@ void LayerTreeHost::layout() void LayerTreeHost::beginCommitOnImplThread(LayerTreeHostImpl* hostImpl) { - DCHECK(m_proxy->isImplThread()); + DCHECK(m_proxy->IsImplThread()); TRACE_EVENT0("cc", "LayerTreeHost::commitTo"); } @@ -255,7 +255,7 @@ void LayerTreeHost::beginCommitOnImplThread(LayerTreeHostImpl* hostImpl) // after the commit, but on the main thread. void LayerTreeHost::finishCommitOnImplThread(LayerTreeHostImpl* hostImpl) { - DCHECK(m_proxy->isImplThread()); + DCHECK(m_proxy->IsImplThread()); // If there are linked evicted backings, these backings' resources may be put into the // impl tree, so we can't draw yet. Determine this before clearing all evicted backings. @@ -375,7 +375,7 @@ scoped_ptr<InputHandler> LayerTreeHost::createInputHandler() scoped_ptr<LayerTreeHostImpl> LayerTreeHost::createLayerTreeHostImpl(LayerTreeHostImplClient* client) { - DCHECK(m_proxy->isImplThread()); + DCHECK(m_proxy->IsImplThread()); scoped_ptr<LayerTreeHostImpl> hostImpl(LayerTreeHostImpl::create(m_settings, client, m_proxy.get())); if (m_settings.calculateTopControlsPosition && hostImpl->topControlsManager()) m_topControlsManagerWeakPtr = hostImpl->topControlsManager()->AsWeakPtr(); @@ -385,7 +385,7 @@ scoped_ptr<LayerTreeHostImpl> LayerTreeHost::createLayerTreeHostImpl(LayerTreeHo void LayerTreeHost::didLoseOutputSurface() { TRACE_EVENT0("cc", "LayerTreeHost::didLoseOutputSurface"); - DCHECK(m_proxy->isMainThread()); + DCHECK(m_proxy->IsMainThread()); m_outputSurfaceLost = true; m_numFailedRecreateAttempts = 0; setNeedsCommit(); @@ -394,7 +394,7 @@ void LayerTreeHost::didLoseOutputSurface() bool LayerTreeHost::compositeAndReadback(void *pixels, const gfx::Rect& rect) { m_triggerIdleUpdates = false; - bool ret = m_proxy->compositeAndReadback(pixels, rect); + bool ret = m_proxy->CompositeAndReadback(pixels, rect); m_triggerIdleUpdates = true; return ret; } @@ -403,12 +403,12 @@ void LayerTreeHost::finishAllRendering() { if (!m_rendererInitialized) return; - m_proxy->finishAllRendering(); + m_proxy->FinishAllRendering(); } void LayerTreeHost::setDeferCommits(bool deferCommits) { - m_proxy->setDeferCommits(deferCommits); + m_proxy->SetDeferCommits(deferCommits); } void LayerTreeHost::didDeferCommit() @@ -419,18 +419,18 @@ void LayerTreeHost::renderingStats(RenderingStats* stats) const { CHECK(m_debugState.recordRenderingStats()); *stats = m_renderingStats; - m_proxy->renderingStats(stats); + m_proxy->GetRenderingStats(stats); } const RendererCapabilities& LayerTreeHost::rendererCapabilities() const { - return m_proxy->rendererCapabilities(); + return m_proxy->GetRendererCapabilities(); } void LayerTreeHost::setNeedsAnimate() { - DCHECK(m_proxy->hasImplThread()); - m_proxy->setNeedsAnimate(); + DCHECK(m_proxy->HasImplThread()); + m_proxy->SetNeedsAnimate(); } void LayerTreeHost::setNeedsCommit() @@ -439,7 +439,7 @@ void LayerTreeHost::setNeedsCommit() TRACE_EVENT_INSTANT0("cc", "LayerTreeHost::setNeedsCommit::cancel prepaint"); m_prepaintCallback.Cancel(); } - m_proxy->setNeedsCommit(); + m_proxy->SetNeedsCommit(); } void LayerTreeHost::setNeedsFullTreeSync() @@ -450,19 +450,19 @@ void LayerTreeHost::setNeedsFullTreeSync() void LayerTreeHost::setNeedsRedraw() { - m_proxy->setNeedsRedraw(); - if (!m_proxy->implThread()) + m_proxy->SetNeedsRedraw(); + if (!m_proxy->ImplThread()) m_client->scheduleComposite(); } bool LayerTreeHost::commitRequested() const { - return m_proxy->commitRequested(); + return m_proxy->CommitRequested(); } void LayerTreeHost::setAnimationEvents(scoped_ptr<AnimationEventsVector> events, base::Time wallClockTime) { - DCHECK(m_proxy->isMainThread()); + DCHECK(m_proxy->IsMainThread()); setAnimationEventsRecursive(*events.get(), m_rootLayer.get(), wallClockTime); } @@ -521,12 +521,12 @@ void LayerTreeHost::setVisible(bool visible) if (m_visible == visible) return; m_visible = visible; - m_proxy->setVisible(visible); + m_proxy->SetVisible(visible); } void LayerTreeHost::startPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnchor, float scale, base::TimeDelta duration) { - m_proxy->startPageScaleAnimation(targetOffset, useAnchor, scale, duration); + m_proxy->StartPageScaleAnimation(targetOffset, useAnchor, scale, duration); } PrioritizedResourceManager* LayerTreeHost::contentsTextureManager() const @@ -536,7 +536,7 @@ PrioritizedResourceManager* LayerTreeHost::contentsTextureManager() const void LayerTreeHost::composite() { - if (!m_proxy->hasImplThread()) + if (!m_proxy->HasImplThread()) static_cast<SingleThreadProxy*>(m_proxy.get())->compositeImmediately(); else setNeedsCommit(); @@ -796,7 +796,7 @@ void LayerTreeHost::startRateLimiter(WebKit::WebGraphicsContext3D* context) if (it != m_rateLimiters.end()) it->second->start(); else { - scoped_refptr<RateLimiter> rateLimiter = RateLimiter::create(context, this, m_proxy->mainThread()); + scoped_refptr<RateLimiter> rateLimiter = RateLimiter::create(context, this, m_proxy->MainThread()); m_rateLimiters[context] = rateLimiter; rateLimiter->start(); } @@ -815,7 +815,7 @@ void LayerTreeHost::rateLimit() { // Force a no-op command on the compositor context, so that any ratelimiting commands will wait for the compositing // context, and therefore for the SwapBuffers. - m_proxy->forceSerializeOnSwapBuffers(); + m_proxy->ForceSerializeOnSwapBuffers(); } bool LayerTreeHost::bufferedUpdates() @@ -846,7 +846,7 @@ void LayerTreeHost::enableHidingTopControls(bool enable) if (!m_settings.calculateTopControlsPosition) return; - m_proxy->implThread()->postTask( + m_proxy->ImplThread()->postTask( base::Bind(&TopControlsManager::enable_hiding_top_controls, m_topControlsManagerWeakPtr, enable)); } @@ -861,7 +861,7 @@ bool LayerTreeHost::blocksPendingCommit() const scoped_ptr<base::Value> LayerTreeHost::asValue() const { scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); - state->Set("proxy", m_proxy->asValue().release()); + state->Set("proxy", m_proxy->AsValue().release()); return state.PassAs<base::Value>(); } @@ -913,7 +913,7 @@ void LayerTreeHost::setAnimationEventsRecursive(const AnimationEventsVector& eve skia::RefPtr<SkPicture> LayerTreeHost::capturePicture() { - return m_proxy->capturePicture(); + return m_proxy->CapturePicture(); } } // namespace cc diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc index 3673402..9d9c7ae 100644 --- a/cc/layer_tree_host_impl.cc +++ b/cc/layer_tree_host_impl.cc @@ -100,7 +100,7 @@ public: // correct. In fact, setting fake thread id's interferes with the real // thread id's and causes breakage. scoped_ptr<DebugScopedSetImplThread> setImplThread; - if (!m_layerTreeHostImpl->proxy()->hasImplThread()) + if (!m_layerTreeHostImpl->proxy()->HasImplThread()) setImplThread.reset(new DebugScopedSetImplThread(m_layerTreeHostImpl->proxy())); m_layerTreeHostImpl->activatePendingTreeIfNeeded(); @@ -156,7 +156,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(const LayerTreeSettings& settings, LayerTre 0, ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING) , m_pinchGestureActive(false) - , m_fpsCounter(FrameRateCounter::create(m_proxy->hasImplThread())) + , m_fpsCounter(FrameRateCounter::create(m_proxy->HasImplThread())) , m_paintTimeCounter(PaintTimeCounter::create()) , m_memoryHistory(MemoryHistory::create()) , m_debugRectHistory(DebugRectHistory::create()) @@ -169,7 +169,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(const LayerTreeSettings& settings, LayerTre , m_lastSentMemoryUseBytes(0) , m_animationRegistrar(AnimationRegistrar::create()) { - DCHECK(m_proxy->isImplThread()); + DCHECK(m_proxy->IsImplThread()); didVisibilityChange(this, m_visible); setDebugState(settings.initialDebugState); @@ -189,7 +189,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(const LayerTreeSettings& settings, LayerTre LayerTreeHostImpl::~LayerTreeHostImpl() { - DCHECK(m_proxy->isImplThread()); + DCHECK(m_proxy->IsImplThread()); TRACE_EVENT0("cc", "LayerTreeHostImpl::~LayerTreeHostImpl()"); if (rootLayer()) { @@ -559,7 +559,7 @@ void LayerTreeHostImpl::setBackgroundTickingEnabled(bool enabled) { // Lazily create the timeSource adapter so that we can vary the interval for testing. if (!m_timeSourceClientAdapter) - m_timeSourceClientAdapter = LayerTreeHostImplTimeSourceAdapter::Create(this, DelayBasedTimeSource::create(lowFrequencyAnimationInterval(), m_proxy->currentThread())); + m_timeSourceClientAdapter = LayerTreeHostImplTimeSourceAdapter::Create(this, DelayBasedTimeSource::create(lowFrequencyAnimationInterval(), m_proxy->CurrentThread())); m_timeSourceClientAdapter->setActive(enabled); } @@ -713,7 +713,7 @@ void LayerTreeHostImpl::EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& po bool LayerTreeHostImpl::HasImplThread() const { - return m_proxy->hasImplThread(); + return m_proxy->HasImplThread(); } void LayerTreeHostImpl::ScheduleManageTiles() @@ -739,13 +739,13 @@ void LayerTreeHostImpl::SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy return; m_managedMemoryPolicy = policy; - if (!m_proxy->hasImplThread()) { + if (!m_proxy->HasImplThread()) { // FIXME: In single-thread mode, this can be called on the main thread // by GLRenderer::onMemoryAllocationChanged. DebugScopedSetImplThread implThread(m_proxy); EnforceManagedMemoryPolicy(m_managedMemoryPolicy); } else { - DCHECK(m_proxy->isImplThread()); + DCHECK(m_proxy->IsImplThread()); EnforceManagedMemoryPolicy(m_managedMemoryPolicy); } // We always need to commit after changing the memory policy because the new @@ -853,7 +853,7 @@ void LayerTreeHostImpl::finishAllRendering() bool LayerTreeHostImpl::isContextLost() { - DCHECK(m_proxy->isImplThread()); + DCHECK(m_proxy->IsImplThread()); return m_renderer && m_renderer->IsContextLost(); } @@ -1033,7 +1033,7 @@ void LayerTreeHostImpl::activatePendingTree() void LayerTreeHostImpl::setVisible(bool visible) { - DCHECK(m_proxy->isImplThread()); + DCHECK(m_proxy->IsImplThread()); if (m_visible == visible) return; diff --git a/cc/layer_tree_host_unittest.cc b/cc/layer_tree_host_unittest.cc index 821c4fe..4d0c4e43 100644 --- a/cc/layer_tree_host_unittest.cc +++ b/cc/layer_tree_host_unittest.cc @@ -693,7 +693,7 @@ public: // We request animation only once. if (!m_animationRequested) { - impl->proxy()->mainThread()->postTask(base::Bind(&LayerTreeHostTestStartPageScaleAnimation::requestStartPageScaleAnimation, base::Unretained(this))); + impl->proxy()->MainThread()->postTask(base::Bind(&LayerTreeHostTestStartPageScaleAnimation::requestStartPageScaleAnimation, base::Unretained(this))); m_animationRequested = true; } } @@ -1592,8 +1592,8 @@ public: void postEvictTextures() { - DCHECK(implThread()); - implThread()->postTask(base::Bind(&LayerTreeHostTestEvictTextures::evictTexturesOnImplThread, + DCHECK(ImplThread()); + ImplThread()->postTask(base::Bind(&LayerTreeHostTestEvictTextures::evictTexturesOnImplThread, base::Unretained(this))); } @@ -1891,7 +1891,7 @@ TEST(LayerTreeHostTest, LimitPartialUpdates) FakeLayerImplTreeHostClient client; scoped_ptr<FakeProxy> proxy = make_scoped_ptr(new FakeProxy(scoped_ptr<Thread>())); - proxy->rendererCapabilities().allowPartialTextureUpdates = false; + proxy->GetRendererCapabilities().allowPartialTextureUpdates = false; proxy->setMaxPartialTextureUpdates(5); LayerTreeSettings settings; @@ -1908,7 +1908,7 @@ TEST(LayerTreeHostTest, LimitPartialUpdates) FakeLayerImplTreeHostClient client; scoped_ptr<FakeProxy> proxy = make_scoped_ptr(new FakeProxy(scoped_ptr<Thread>())); - proxy->rendererCapabilities().allowPartialTextureUpdates = true; + proxy->GetRendererCapabilities().allowPartialTextureUpdates = true; proxy->setMaxPartialTextureUpdates(5); LayerTreeSettings settings; @@ -1925,7 +1925,7 @@ TEST(LayerTreeHostTest, LimitPartialUpdates) FakeLayerImplTreeHostClient client; scoped_ptr<FakeProxy> proxy = make_scoped_ptr(new FakeProxy(scoped_ptr<Thread>())); - proxy->rendererCapabilities().allowPartialTextureUpdates = true; + proxy->GetRendererCapabilities().allowPartialTextureUpdates = true; proxy->setMaxPartialTextureUpdates(20); LayerTreeSettings settings; @@ -2081,7 +2081,7 @@ public: virtual void drawLayersOnThread(LayerTreeHostImpl* hostImpl) OVERRIDE { - DCHECK(hostImpl->proxy()->hasImplThread()); + DCHECK(hostImpl->proxy()->HasImplThread()); const ThreadProxy* proxy = static_cast<ThreadProxy*>(hostImpl->proxy()); if (m_delegatingRenderer) diff --git a/cc/layer_tree_host_unittest_context.cc b/cc/layer_tree_host_unittest_context.cc index ab7fb23..bd82138 100644 --- a/cc/layer_tree_host_unittest_context.cc +++ b/cc/layer_tree_host_unittest_context.cc @@ -124,7 +124,7 @@ class LayerTreeHostContextTest : public ThreadedTest { virtual scoped_refptr<cc::ContextProvider> OffscreenContextProviderForMainThread() OVERRIDE { - DCHECK(!implThread()); + DCHECK(!ImplThread()); if (!offscreen_contexts_main_thread_ || offscreen_contexts_main_thread_->DestroyedOnMainThread()) { @@ -137,7 +137,7 @@ class LayerTreeHostContextTest : public ThreadedTest { virtual scoped_refptr<cc::ContextProvider> OffscreenContextProviderForCompositorThread() OVERRIDE { - DCHECK(implThread()); + DCHECK(ImplThread()); if (!offscreen_contexts_compositor_thread_ || offscreen_contexts_compositor_thread_->DestroyedOnMainThread()) { @@ -661,8 +661,8 @@ class LayerTreeHostContextTestLostContextAndEvictTextures : } void PostEvictTextures() { - if (implThread()) { - implThread()->postTask( + if (ImplThread()) { + ImplThread()->postTask( base::Bind( &LayerTreeHostContextTestLostContextAndEvictTextures:: EvictTexturesOnImplThread, diff --git a/cc/prioritized_resource.cc b/cc/prioritized_resource.cc index 7436a9d..74de0b4 100644 --- a/cc/prioritized_resource.cc +++ b/cc/prioritized_resource.cc @@ -150,7 +150,7 @@ PrioritizedResource::Backing::~Backing() void PrioritizedResource::Backing::deleteResource(ResourceProvider* resourceProvider) { - DCHECK(!proxy() || proxy()->isImplThread()); + DCHECK(!proxy() || proxy()->IsImplThread()); DCHECK(!m_resourceHasBeenDeleted); #ifndef NDEBUG DCHECK(resourceProvider == m_resourceProvider); @@ -163,19 +163,19 @@ void PrioritizedResource::Backing::deleteResource(ResourceProvider* resourceProv bool PrioritizedResource::Backing::resourceHasBeenDeleted() const { - DCHECK(!proxy() || proxy()->isImplThread()); + DCHECK(!proxy() || proxy()->IsImplThread()); return m_resourceHasBeenDeleted; } bool PrioritizedResource::Backing::canBeRecycled() const { - DCHECK(!proxy() || proxy()->isImplThread()); + DCHECK(!proxy() || proxy()->IsImplThread()); return !m_wasAbovePriorityCutoffAtLastPriorityUpdate && !m_inDrawingImplTree; } void PrioritizedResource::Backing::updatePriority() { - DCHECK(!proxy() || proxy()->isImplThread() && proxy()->isMainThreadBlocked()); + DCHECK(!proxy() || proxy()->IsImplThread() && proxy()->IsMainThreadBlocked()); if (m_owner) { m_priorityAtLastPriorityUpdate = m_owner->requestPriority(); m_wasAbovePriorityCutoffAtLastPriorityUpdate = m_owner->isAbovePriorityCutoff(); @@ -187,7 +187,7 @@ void PrioritizedResource::Backing::updatePriority() void PrioritizedResource::Backing::updateInDrawingImplTree() { - DCHECK(!proxy() || proxy()->isImplThread() && proxy()->isMainThreadBlocked()); + DCHECK(!proxy() || proxy()->IsImplThread() && proxy()->IsMainThreadBlocked()); m_inDrawingImplTree = !!owner(); if (!m_inDrawingImplTree) DCHECK(m_priorityAtLastPriorityUpdate == PriorityCalculator::lowestPriority()); diff --git a/cc/prioritized_resource_manager.cc b/cc/prioritized_resource_manager.cc index 009f1fc..05c0efb 100644 --- a/cc/prioritized_resource_manager.cc +++ b/cc/prioritized_resource_manager.cc @@ -43,20 +43,20 @@ PrioritizedResourceManager::~PrioritizedResourceManager() size_t PrioritizedResourceManager::memoryVisibleBytes() const { - DCHECK(m_proxy->isImplThread()); + DCHECK(m_proxy->IsImplThread()); return m_memoryVisibleLastPushedBytes; } size_t PrioritizedResourceManager::memoryVisibleAndNearbyBytes() const { - DCHECK(m_proxy->isImplThread()); + DCHECK(m_proxy->IsImplThread()); return m_memoryVisibleAndNearbyLastPushedBytes; } void PrioritizedResourceManager::prioritizeTextures() { TRACE_EVENT0("cc", "PrioritizedResourceManager::prioritizeTextures"); - DCHECK(m_proxy->isMainThread()); + DCHECK(m_proxy->IsMainThread()); // Sorting textures in this function could be replaced by a slightly // modified O(n) quick-select to partition textures rather than @@ -130,7 +130,7 @@ void PrioritizedResourceManager::prioritizeTextures() void PrioritizedResourceManager::pushTexturePrioritiesToBackings() { TRACE_EVENT0("cc", "PrioritizedResourceManager::pushTexturePrioritiesToBackings"); - DCHECK(m_proxy->isImplThread() && m_proxy->isMainThreadBlocked()); + DCHECK(m_proxy->IsImplThread() && m_proxy->IsMainThreadBlocked()); assertInvariants(); for (BackingList::iterator it = m_backings.begin(); it != m_backings.end(); ++it) @@ -146,7 +146,7 @@ void PrioritizedResourceManager::pushTexturePrioritiesToBackings() void PrioritizedResourceManager::updateBackingsInDrawingImplTree() { TRACE_EVENT0("cc", "PrioritizedResourceManager::updateBackingsInDrawingImplTree"); - DCHECK(m_proxy->isImplThread() && m_proxy->isMainThreadBlocked()); + DCHECK(m_proxy->IsImplThread() && m_proxy->IsMainThreadBlocked()); assertInvariants(); for (BackingList::iterator it = m_backings.begin(); it != m_backings.end(); ++it) { @@ -160,7 +160,7 @@ void PrioritizedResourceManager::updateBackingsInDrawingImplTree() void PrioritizedResourceManager::sortBackings() { TRACE_EVENT0("cc", "PrioritizedResourceManager::sortBackings"); - DCHECK(m_proxy->isImplThread()); + DCHECK(m_proxy->IsImplThread()); // Put backings in eviction/recycling order. m_backings.sort(compareBackings); @@ -169,7 +169,7 @@ void PrioritizedResourceManager::sortBackings() void PrioritizedResourceManager::clearPriorities() { - DCHECK(m_proxy->isMainThread()); + DCHECK(m_proxy->IsMainThread()); for (TextureSet::iterator it = m_textures.begin(); it != m_textures.end(); ++it) { // FIXME: We should remove this and just set all priorities to // PriorityCalculator::lowestPriority() once we have priorities @@ -181,7 +181,7 @@ void PrioritizedResourceManager::clearPriorities() bool PrioritizedResourceManager::requestLate(PrioritizedResource* texture) { - DCHECK(m_proxy->isMainThread()); + DCHECK(m_proxy->IsMainThread()); // This is already above cutoff, so don't double count it's memory below. if (texture->isAbovePriorityCutoff()) @@ -206,7 +206,7 @@ bool PrioritizedResourceManager::requestLate(PrioritizedResource* texture) void PrioritizedResourceManager::acquireBackingTextureIfNeeded(PrioritizedResource* texture, ResourceProvider* resourceProvider) { - DCHECK(m_proxy->isImplThread() && m_proxy->isMainThreadBlocked()); + DCHECK(m_proxy->IsImplThread() && m_proxy->IsMainThreadBlocked()); DCHECK(!texture->isSelfManaged()); DCHECK(texture->isAbovePriorityCutoff()); if (texture->backing() || !texture->isAbovePriorityCutoff()) @@ -256,9 +256,9 @@ bool PrioritizedResourceManager::evictBackingsToReduceMemory(size_t limitBytes, UnlinkPolicy unlinkPolicy, ResourceProvider* resourceProvider) { - DCHECK(m_proxy->isImplThread()); + DCHECK(m_proxy->IsImplThread()); if (unlinkPolicy == UnlinkBackings) - DCHECK(m_proxy->isMainThreadBlocked()); + DCHECK(m_proxy->IsMainThreadBlocked()); if (memoryUseBytes() <= limitBytes && PriorityCalculator::allowEverythingCutoff() == priorityCutoff) return false; @@ -302,7 +302,7 @@ void PrioritizedResourceManager::reduceWastedMemory(ResourceProvider* resourcePr void PrioritizedResourceManager::reduceMemory(ResourceProvider* resourceProvider) { - DCHECK(m_proxy->isImplThread() && m_proxy->isMainThreadBlocked()); + DCHECK(m_proxy->IsImplThread() && m_proxy->IsMainThreadBlocked()); evictBackingsToReduceMemory(m_memoryAvailableBytes, PriorityCalculator::allowEverythingCutoff(), EvictAnything, @@ -315,7 +315,7 @@ void PrioritizedResourceManager::reduceMemory(ResourceProvider* resourceProvider void PrioritizedResourceManager::clearAllMemory(ResourceProvider* resourceProvider) { - DCHECK(m_proxy->isImplThread() && m_proxy->isMainThreadBlocked()); + DCHECK(m_proxy->IsImplThread() && m_proxy->IsMainThreadBlocked()); if (!resourceProvider) { DCHECK(m_backings.empty()); return; @@ -329,7 +329,7 @@ void PrioritizedResourceManager::clearAllMemory(ResourceProvider* resourceProvid bool PrioritizedResourceManager::reduceMemoryOnImplThread(size_t limitBytes, int priorityCutoff, ResourceProvider* resourceProvider) { - DCHECK(m_proxy->isImplThread()); + DCHECK(m_proxy->IsImplThread()); DCHECK(resourceProvider); // If we are in the process of uploading a new frame then the backings at the very end of // the list are not sorted by priority. Sort them before doing the eviction. @@ -344,7 +344,7 @@ bool PrioritizedResourceManager::reduceMemoryOnImplThread(size_t limitBytes, int void PrioritizedResourceManager::reduceWastedMemoryOnImplThread(ResourceProvider* resourceProvider) { - DCHECK(m_proxy->isImplThread()); + DCHECK(m_proxy->IsImplThread()); DCHECK(resourceProvider); // If we are in the process of uploading a new frame then the backings at the very end of // the list are not sorted by priority. Sort them before doing the eviction. @@ -355,7 +355,7 @@ void PrioritizedResourceManager::reduceWastedMemoryOnImplThread(ResourceProvider void PrioritizedResourceManager::unlinkAndClearEvictedBackings() { - DCHECK(m_proxy->isMainThread()); + DCHECK(m_proxy->IsMainThread()); base::AutoLock scoped_lock(m_evictedBackingsLock); for (BackingList::const_iterator it = m_evictedBackings.begin(); it != m_evictedBackings.end(); ++it) { PrioritizedResource::Backing* backing = (*it); @@ -368,7 +368,7 @@ void PrioritizedResourceManager::unlinkAndClearEvictedBackings() bool PrioritizedResourceManager::linkedEvictedBackingsExist() const { - DCHECK(m_proxy->isImplThread() && m_proxy->isMainThreadBlocked()); + DCHECK(m_proxy->IsImplThread() && m_proxy->IsMainThreadBlocked()); base::AutoLock scoped_lock(m_evictedBackingsLock); for (BackingList::const_iterator it = m_evictedBackings.begin(); it != m_evictedBackings.end(); ++it) { if ((*it)->owner()) @@ -379,7 +379,7 @@ bool PrioritizedResourceManager::linkedEvictedBackingsExist() const void PrioritizedResourceManager::registerTexture(PrioritizedResource* texture) { - DCHECK(m_proxy->isMainThread()); + DCHECK(m_proxy->IsMainThread()); DCHECK(texture); DCHECK(!texture->resourceManager()); DCHECK(!texture->backing()); @@ -392,7 +392,7 @@ void PrioritizedResourceManager::registerTexture(PrioritizedResource* texture) void PrioritizedResourceManager::unregisterTexture(PrioritizedResource* texture) { - DCHECK(m_proxy->isMainThread() || (m_proxy->isImplThread() && m_proxy->isMainThreadBlocked())); + DCHECK(m_proxy->IsMainThread() || (m_proxy->IsImplThread() && m_proxy->IsMainThreadBlocked())); DCHECK(texture); DCHECK(ContainsKey(m_textures, texture)); @@ -404,14 +404,14 @@ void PrioritizedResourceManager::unregisterTexture(PrioritizedResource* texture) void PrioritizedResourceManager::returnBackingTexture(PrioritizedResource* texture) { - DCHECK(m_proxy->isMainThread() || (m_proxy->isImplThread() && m_proxy->isMainThreadBlocked())); + DCHECK(m_proxy->IsMainThread() || (m_proxy->IsImplThread() && m_proxy->IsMainThreadBlocked())); if (texture->backing()) texture->unlink(); } PrioritizedResource::Backing* PrioritizedResourceManager::createBacking(gfx::Size size, GLenum format, ResourceProvider* resourceProvider) { - DCHECK(m_proxy->isImplThread() && m_proxy->isMainThreadBlocked()); + DCHECK(m_proxy->IsImplThread() && m_proxy->IsMainThreadBlocked()); DCHECK(resourceProvider); ResourceProvider::ResourceId resourceId = resourceProvider->CreateManagedResource(size, format, ResourceProvider::TextureUsageAny); PrioritizedResource::Backing* backing = new PrioritizedResource::Backing(resourceId, resourceProvider, size, format); @@ -421,7 +421,7 @@ PrioritizedResource::Backing* PrioritizedResourceManager::createBacking(gfx::Siz void PrioritizedResourceManager::evictFirstBackingResource(ResourceProvider* resourceProvider) { - DCHECK(m_proxy->isImplThread()); + DCHECK(m_proxy->IsImplThread()); DCHECK(resourceProvider); DCHECK(!m_backings.empty()); PrioritizedResource::Backing* backing = m_backings.front(); @@ -440,7 +440,7 @@ void PrioritizedResourceManager::evictFirstBackingResource(ResourceProvider* res void PrioritizedResourceManager::assertInvariants() { #ifndef NDEBUG - DCHECK(m_proxy->isImplThread() && m_proxy->isMainThreadBlocked()); + DCHECK(m_proxy->IsImplThread() && m_proxy->IsMainThreadBlocked()); // If we hit any of these asserts, there is a bug in this class. To see // where the bug is, call this function at the beginning and end of diff --git a/cc/proxy.cc b/cc/proxy.cc index 9a07254..7536309 100644 --- a/cc/proxy.cc +++ b/cc/proxy.cc @@ -9,89 +9,73 @@ namespace cc { -Thread* Proxy::mainThread() const -{ - return m_mainThread.get(); -} +Thread* Proxy::MainThread() const { return main_thread_.get(); } -bool Proxy::hasImplThread() const -{ - return m_implThread; -} +bool Proxy::HasImplThread() const { return impl_thread_; } -Thread* Proxy::implThread() const -{ - return m_implThread.get(); -} +Thread* Proxy::ImplThread() const { return impl_thread_.get(); } -Thread* Proxy::currentThread() const -{ - if (mainThread() && mainThread()->belongsToCurrentThread()) - return mainThread(); - if (implThread() && implThread()->belongsToCurrentThread()) - return implThread(); - return 0; +Thread* Proxy::CurrentThread() const { + if (MainThread() && MainThread()->belongsToCurrentThread()) + return MainThread(); + if (ImplThread() && ImplThread()->belongsToCurrentThread()) + return ImplThread(); + return NULL; } -bool Proxy::isMainThread() const -{ +bool Proxy::IsMainThread() const { #ifndef NDEBUG - DCHECK(mainThread()); - if (m_implThreadIsOverridden) - return false; - return mainThread()->belongsToCurrentThread(); + DCHECK(MainThread()); + if (impl_thread_is_overridden_) + return false; + return MainThread()->belongsToCurrentThread(); #else - return true; + return true; #endif } -bool Proxy::isImplThread() const -{ +bool Proxy::IsImplThread() const { #ifndef NDEBUG - if (m_implThreadIsOverridden) - return true; - return implThread() && implThread()->belongsToCurrentThread(); -#else + if (impl_thread_is_overridden_) return true; + return ImplThread() && ImplThread()->belongsToCurrentThread(); +#else + return true; #endif } #ifndef NDEBUG -void Proxy::setCurrentThreadIsImplThread(bool isImplThread) -{ - m_implThreadIsOverridden = isImplThread; +void Proxy::SetCurrentThreadIsImplThread(bool is_impl_thread) { + impl_thread_is_overridden_ = is_impl_thread; } #endif -bool Proxy::isMainThreadBlocked() const -{ +bool Proxy::IsMainThreadBlocked() const { #ifndef NDEBUG - return m_isMainThreadBlocked; + return is_main_thread_blocked_; #else - return true; + return true; #endif } #ifndef NDEBUG -void Proxy::setMainThreadBlocked(bool isMainThreadBlocked) -{ - m_isMainThreadBlocked = isMainThreadBlocked; +void Proxy::SetMainThreadBlocked(bool is_main_thread_blocked) { + is_main_thread_blocked_ = is_main_thread_blocked; } #endif -Proxy::Proxy(scoped_ptr<Thread> implThread) - : m_mainThread(ThreadImpl::createForCurrentThread()) - , m_implThread(implThread.Pass()) -#ifndef NDEBUG - , m_implThreadIsOverridden(false) - , m_isMainThreadBlocked(false) +Proxy::Proxy(scoped_ptr<Thread> impl_thread) + : main_thread_(ThreadImpl::createForCurrentThread()), +#ifdef NDEBUG + impl_thread_(impl_thread.Pass()) {} +#else + impl_thread_(impl_thread.Pass()), + impl_thread_is_overridden_(false), + is_main_thread_blocked_(false) {} #endif -{ -} -Proxy::~Proxy() -{ - DCHECK(isMainThread()); +Proxy::~Proxy() { + DCHECK(IsMainThread()); } } // namespace cc @@ -28,122 +28,127 @@ struct RendererCapabilities; // Abstract class responsible for proxying commands from the main-thread side of // the compositor over to the compositor implementation. class CC_EXPORT Proxy { -public: - Thread* mainThread() const; - bool hasImplThread() const; - Thread* implThread() const; - - // Returns 0 if the current thread is neither the main thread nor the impl thread. - Thread* currentThread() const; - - // Debug hooks - bool isMainThread() const; - bool isImplThread() const; - bool isMainThreadBlocked() const; + public: + Thread* MainThread() const; + bool HasImplThread() const; + Thread* ImplThread() const; + + // Returns 0 if the current thread is neither the main thread nor the impl + // thread. + Thread* CurrentThread() const; + + // Debug hooks. + bool IsMainThread() const; + bool IsImplThread() const; + bool IsMainThreadBlocked() const; #ifndef NDEBUG - void setMainThreadBlocked(bool); - void setCurrentThreadIsImplThread(bool); + void SetMainThreadBlocked(bool is_main_thread_blocked); + void SetCurrentThreadIsImplThread(bool is_impl_thread); #endif - virtual ~Proxy(); + virtual ~Proxy(); - virtual bool compositeAndReadback(void *pixels, const gfx::Rect&) = 0; + virtual bool CompositeAndReadback(void* pixels, gfx::Rect rect) = 0; - virtual void startPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnchor, float scale, base::TimeDelta duration) = 0; + virtual void StartPageScaleAnimation(gfx::Vector2d target_offset, + bool use_anchor, + float scale, + base::TimeDelta duration) = 0; - virtual void finishAllRendering() = 0; + virtual void FinishAllRendering() = 0; - virtual bool isStarted() const = 0; + virtual bool IsStarted() const = 0; - // Attempts to initialize a context to use for rendering. Returns false if the context could not be created. - // The context will not be used and no frames may be produced until initializeRenderer() is called. - virtual bool initializeOutputSurface() = 0; + // Attempts to initialize a context to use for rendering. Returns false if + // the context could not be created. The context will not be used and no + // frames may be produced until InitializeRenderer() is called. + virtual bool InitializeOutputSurface() = 0; - // Indicates that the compositing surface associated with our context is ready to use. - virtual void setSurfaceReady() = 0; + // Indicates that the compositing surface associated with our context is + // ready to use. + virtual void SetSurfaceReady() = 0; - virtual void setVisible(bool) = 0; + virtual void SetVisible(bool visible) = 0; - // Attempts to initialize the layer renderer. Returns false if the context isn't usable for compositing. - virtual bool initializeRenderer() = 0; + // Attempts to initialize the layer renderer. Returns false if the context + // isn't usable for compositing. + virtual bool InitializeRenderer() = 0; - // Attempts to recreate the context and layer renderer after a context lost. Returns false if the renderer couldn't be - // reinitialized. - virtual bool recreateOutputSurface() = 0; + // Attempts to recreate the context and layer renderer after a context lost. + // Returns false if the renderer couldn't be reinitialized. + virtual bool RecreateOutputSurface() = 0; - virtual void renderingStats(RenderingStats*) = 0; + virtual void GetRenderingStats(RenderingStats* stats) = 0; - virtual const RendererCapabilities& rendererCapabilities() const = 0; + virtual const RendererCapabilities& GetRendererCapabilities() const = 0; - virtual void setNeedsAnimate() = 0; - virtual void setNeedsCommit() = 0; - virtual void setNeedsRedraw() = 0; + virtual void SetNeedsAnimate() = 0; + virtual void SetNeedsCommit() = 0; + virtual void SetNeedsRedraw() = 0; - // Defers commits until it is reset. It is only supported when in threaded mode. It's an error to make a sync call - // like compositeAndReadback while commits are deferred. - virtual void setDeferCommits(bool) = 0; + // Defers commits until it is reset. It is only supported when in threaded + // mode. It's an error to make a sync call like compositeAndReadback while + // commits are deferred. + virtual void SetDeferCommits(bool defer_commits) = 0; - virtual void mainThreadHasStoppedFlinging() = 0; + virtual void MainThreadHasStoppedFlinging() = 0; - virtual bool commitRequested() const = 0; + virtual bool CommitRequested() const = 0; - virtual void start() = 0; // Must be called before using the proxy. - virtual void stop() = 0; // Must be called before deleting the proxy. + virtual void Start() = 0; // Must be called before using the proxy. + virtual void Stop() = 0; // Must be called before deleting the proxy. - // Forces 3D commands on all contexts to wait for all previous SwapBuffers to finish before executing in the GPU - // process. - virtual void forceSerializeOnSwapBuffers() = 0; + // Forces 3D commands on all contexts to wait for all previous SwapBuffers + // to finish before executing in the GPU process. + virtual void ForceSerializeOnSwapBuffers() = 0; - // Maximum number of sub-region texture updates supported for each commit. - virtual size_t maxPartialTextureUpdates() const = 0; + // Maximum number of sub-region texture updates supported for each commit. + virtual size_t MaxPartialTextureUpdates() const = 0; - virtual void acquireLayerTextures() = 0; + virtual void AcquireLayerTextures() = 0; - virtual skia::RefPtr<SkPicture> capturePicture() = 0; - virtual scoped_ptr<base::Value> asValue() const = 0; + virtual skia::RefPtr<SkPicture> CapturePicture() = 0; + virtual scoped_ptr<base::Value> AsValue() const = 0; - // Testing hooks - virtual bool commitPendingForTesting() = 0; + // Testing hooks + virtual bool CommitPendingForTesting() = 0; -protected: - explicit Proxy(scoped_ptr<Thread> implThread); - friend class DebugScopedSetImplThread; - friend class DebugScopedSetMainThread; - friend class DebugScopedSetMainThreadBlocked; + protected: + explicit Proxy(scoped_ptr<Thread> impl_thread); + friend class DebugScopedSetImplThread; + friend class DebugScopedSetMainThread; + friend class DebugScopedSetMainThreadBlocked; -private: - DISALLOW_COPY_AND_ASSIGN(Proxy); + private: + DISALLOW_COPY_AND_ASSIGN(Proxy); - scoped_ptr<Thread> m_mainThread; - scoped_ptr<Thread> m_implThread; + scoped_ptr<Thread> main_thread_; + scoped_ptr<Thread> impl_thread_; #ifndef NDEBUG - bool m_implThreadIsOverridden; - bool m_isMainThreadBlocked; + bool impl_thread_is_overridden_; + bool is_main_thread_blocked_; #endif }; #ifndef NDEBUG class DebugScopedSetMainThreadBlocked { -public: - explicit DebugScopedSetMainThreadBlocked(Proxy* proxy) - : m_proxy(proxy) - { - DCHECK(!m_proxy->isMainThreadBlocked()); - m_proxy->setMainThreadBlocked(true); - } - ~DebugScopedSetMainThreadBlocked() - { - DCHECK(m_proxy->isMainThreadBlocked()); - m_proxy->setMainThreadBlocked(false); - } -private: - Proxy* m_proxy; + public: + explicit DebugScopedSetMainThreadBlocked(Proxy* proxy) : proxy_(proxy) { + DCHECK(!proxy_->IsMainThreadBlocked()); + proxy_->SetMainThreadBlocked(true); + } + ~DebugScopedSetMainThreadBlocked() { + DCHECK(proxy_->IsMainThreadBlocked()); + proxy_->SetMainThreadBlocked(false); + } + private: + Proxy* proxy_; }; #else class DebugScopedSetMainThreadBlocked { -public: - explicit DebugScopedSetMainThreadBlocked(Proxy*) { } - ~DebugScopedSetMainThreadBlocked() { } + public: + explicit DebugScopedSetMainThreadBlocked(Proxy* proxy) {} + ~DebugScopedSetMainThreadBlocked() {} }; #endif diff --git a/cc/resource_update_controller_unittest.cc b/cc/resource_update_controller_unittest.cc index b9da17a..280627d 100644 --- a/cc/resource_update_controller_unittest.cc +++ b/cc/resource_update_controller_unittest.cc @@ -183,7 +183,7 @@ protected: scoped_ptr<ResourceUpdateController> updateController = ResourceUpdateController::Create( NULL, - m_proxy.implThread(), + m_proxy.ImplThread(), m_queue.Pass(), m_resourceProvider.get()); updateController->Finalize(); diff --git a/cc/single_thread_proxy.cc b/cc/single_thread_proxy.cc index 5fa8091..e8fe6d7e 100644 --- a/cc/single_thread_proxy.cc +++ b/cc/single_thread_proxy.cc @@ -33,14 +33,14 @@ SingleThreadProxy::SingleThreadProxy(LayerTreeHost* layerTreeHost) , m_totalCommitCount(0) { TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy"); - DCHECK(Proxy::isMainThread()); + DCHECK(Proxy::IsMainThread()); DCHECK(layerTreeHost); // Impl-side painting not supported without threaded compositing DCHECK(!layerTreeHost->settings().implSidePainting); } -void SingleThreadProxy::start() +void SingleThreadProxy::Start() { DebugScopedSetImplThread impl(this); m_layerTreeHostImpl = m_layerTreeHost->createLayerTreeHostImpl(this); @@ -49,14 +49,14 @@ void SingleThreadProxy::start() SingleThreadProxy::~SingleThreadProxy() { TRACE_EVENT0("cc", "SingleThreadProxy::~SingleThreadProxy"); - DCHECK(Proxy::isMainThread()); - DCHECK(!m_layerTreeHostImpl.get() && !m_layerTreeHost); // make sure stop() got called. + DCHECK(Proxy::IsMainThread()); + DCHECK(!m_layerTreeHostImpl.get() && !m_layerTreeHost); // make sure Stop() got called. } -bool SingleThreadProxy::compositeAndReadback(void *pixels, const gfx::Rect& rect) +bool SingleThreadProxy::CompositeAndReadback(void *pixels, gfx::Rect rect) { TRACE_EVENT0("cc", "SingleThreadProxy::compositeAndReadback"); - DCHECK(Proxy::isMainThread()); + DCHECK(Proxy::IsMainThread()); if (!commitAndComposite()) return false; @@ -75,29 +75,29 @@ bool SingleThreadProxy::compositeAndReadback(void *pixels, const gfx::Rect& rect return true; } -void SingleThreadProxy::startPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnchor, float scale, base::TimeDelta duration) +void SingleThreadProxy::StartPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnchor, float scale, base::TimeDelta duration) { m_layerTreeHostImpl->startPageScaleAnimation(targetOffset, useAnchor, scale, base::TimeTicks::Now(), duration); } -void SingleThreadProxy::finishAllRendering() +void SingleThreadProxy::FinishAllRendering() { - DCHECK(Proxy::isMainThread()); + DCHECK(Proxy::IsMainThread()); { DebugScopedSetImplThread impl(this); m_layerTreeHostImpl->finishAllRendering(); } } -bool SingleThreadProxy::isStarted() const +bool SingleThreadProxy::IsStarted() const { - DCHECK(Proxy::isMainThread()); + DCHECK(Proxy::IsMainThread()); return m_layerTreeHostImpl.get(); } -bool SingleThreadProxy::initializeOutputSurface() +bool SingleThreadProxy::InitializeOutputSurface() { - DCHECK(Proxy::isMainThread()); + DCHECK(Proxy::IsMainThread()); scoped_ptr<OutputSurface> outputSurface = m_layerTreeHost->createOutputSurface(); if (!outputSurface.get()) return false; @@ -105,20 +105,20 @@ bool SingleThreadProxy::initializeOutputSurface() return true; } -void SingleThreadProxy::setSurfaceReady() +void SingleThreadProxy::SetSurfaceReady() { // Scheduling is controlled by the embedder in the single thread case, so nothing to do. } -void SingleThreadProxy::setVisible(bool visible) +void SingleThreadProxy::SetVisible(bool visible) { DebugScopedSetImplThread impl(this); m_layerTreeHostImpl->setVisible(visible); } -bool SingleThreadProxy::initializeRenderer() +bool SingleThreadProxy::InitializeRenderer() { - DCHECK(Proxy::isMainThread()); + DCHECK(Proxy::IsMainThread()); DCHECK(m_outputSurfaceBeforeInitialization.get()); { DebugScopedSetImplThread impl(this); @@ -132,10 +132,10 @@ bool SingleThreadProxy::initializeRenderer() } } -bool SingleThreadProxy::recreateOutputSurface() +bool SingleThreadProxy::RecreateOutputSurface() { TRACE_EVENT0("cc", "SingleThreadProxy::recreateContext"); - DCHECK(Proxy::isMainThread()); + DCHECK(Proxy::IsMainThread()); DCHECK(m_outputSurfaceLost); scoped_ptr<OutputSurface> outputSurface = m_layerTreeHost->createOutputSurface(); @@ -168,21 +168,21 @@ bool SingleThreadProxy::recreateOutputSurface() return initialized; } -void SingleThreadProxy::renderingStats(RenderingStats* stats) +void SingleThreadProxy::GetRenderingStats(RenderingStats* stats) { stats->totalCommitTime = m_totalCommitTime; stats->totalCommitCount = m_totalCommitCount; m_layerTreeHostImpl->renderingStats(stats); } -const RendererCapabilities& SingleThreadProxy::rendererCapabilities() const +const RendererCapabilities& SingleThreadProxy::GetRendererCapabilities() const { DCHECK(m_rendererInitialized); // Note: this gets called during the commit by the "impl" thread return m_RendererCapabilitiesForMainThread; } -void SingleThreadProxy::setNeedsAnimate() +void SingleThreadProxy::SetNeedsAnimate() { // Thread-only feature NOTREACHED(); @@ -190,7 +190,7 @@ void SingleThreadProxy::setNeedsAnimate() void SingleThreadProxy::doCommit(scoped_ptr<ResourceUpdateQueue> queue) { - DCHECK(Proxy::isMainThread()); + DCHECK(Proxy::IsMainThread()); // Commit immediately { DebugScopedSetMainThreadBlocked mainThreadBlocked(this); @@ -205,7 +205,7 @@ void SingleThreadProxy::doCommit(scoped_ptr<ResourceUpdateQueue> queue) scoped_ptr<ResourceUpdateController> updateController = ResourceUpdateController::Create( NULL, - Proxy::mainThread(), + Proxy::MainThread(), queue.Pass(), m_layerTreeHostImpl->resourceProvider()); updateController->Finalize(); @@ -229,18 +229,18 @@ void SingleThreadProxy::doCommit(scoped_ptr<ResourceUpdateQueue> queue) m_nextFrameIsNewlyCommittedFrame = true; } -void SingleThreadProxy::setNeedsCommit() +void SingleThreadProxy::SetNeedsCommit() { - DCHECK(Proxy::isMainThread()); + DCHECK(Proxy::IsMainThread()); m_layerTreeHost->scheduleComposite(); } -void SingleThreadProxy::setNeedsRedraw() +void SingleThreadProxy::SetNeedsRedraw() { // FIXME: Once we move render_widget scheduling into this class, we can // treat redraw requests more efficiently than commitAndRedraw requests. m_layerTreeHostImpl->SetFullRootLayerDamage(); - setNeedsCommit(); + SetNeedsCommit(); } void SingleThreadProxy::onHasPendingTreeStateChanged(bool havePendingTree) @@ -249,26 +249,26 @@ void SingleThreadProxy::onHasPendingTreeStateChanged(bool havePendingTree) NOTREACHED(); } -void SingleThreadProxy::setDeferCommits(bool deferCommits) +void SingleThreadProxy::SetDeferCommits(bool deferCommits) { // Thread-only feature. NOTREACHED(); } -bool SingleThreadProxy::commitRequested() const +bool SingleThreadProxy::CommitRequested() const { return false; } -size_t SingleThreadProxy::maxPartialTextureUpdates() const +size_t SingleThreadProxy::MaxPartialTextureUpdates() const { return std::numeric_limits<size_t>::max(); } -void SingleThreadProxy::stop() +void SingleThreadProxy::Stop() { TRACE_EVENT0("cc", "SingleThreadProxy::stop"); - DCHECK(Proxy::isMainThread()); + DCHECK(Proxy::IsMainThread()); { DebugScopedSetMainThreadBlocked mainThreadBlocked(this); DebugScopedSetImplThread impl(this); @@ -302,14 +302,14 @@ void SingleThreadProxy::setNeedsManageTilesOnImplThread() void SingleThreadProxy::postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector> events, base::Time wallClockTime) { - DCHECK(Proxy::isImplThread()); + DCHECK(Proxy::IsImplThread()); DebugScopedSetMainThread main(this); m_layerTreeHost->setAnimationEvents(events.Pass(), wallClockTime); } bool SingleThreadProxy::reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int priorityCutoff) { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); if (!m_layerTreeHost->contentsTextureManager()) return false; @@ -324,7 +324,7 @@ void SingleThreadProxy::reduceWastedContentsTextureMemoryOnImplThread() void SingleThreadProxy::sendManagedMemoryStats() { - DCHECK(Proxy::isImplThread()); + DCHECK(Proxy::IsImplThread()); if (!m_layerTreeHostImpl.get()) return; if (!m_layerTreeHost->contentsTextureManager()) @@ -356,12 +356,12 @@ void SingleThreadProxy::compositeImmediately() } } -scoped_ptr<base::Value> SingleThreadProxy::asValue() const +scoped_ptr<base::Value> SingleThreadProxy::AsValue() const { scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); { // The following line casts away const modifiers because it is just - // setting debug state. We still want the asValue() function and its + // setting debug state. We still want the AsValue() function and its // call chain to be const throughout. DebugScopedSetImplThread impl(const_cast<SingleThreadProxy*>(this)); @@ -370,7 +370,7 @@ scoped_ptr<base::Value> SingleThreadProxy::asValue() const return state.PassAs<base::Value>(); } -void SingleThreadProxy::forceSerializeOnSwapBuffers() +void SingleThreadProxy::ForceSerializeOnSwapBuffers() { { DebugScopedSetImplThread impl(this); @@ -386,7 +386,7 @@ void SingleThreadProxy::onSwapBuffersCompleteOnImplThread() bool SingleThreadProxy::commitAndComposite() { - DCHECK(Proxy::isMainThread()); + DCHECK(Proxy::IsMainThread()); if (!m_layerTreeHost->initializeRendererIfNeeded()) return false; @@ -459,12 +459,12 @@ void SingleThreadProxy::didSwapFrame() } } -bool SingleThreadProxy::commitPendingForTesting() +bool SingleThreadProxy::CommitPendingForTesting() { return false; } -skia::RefPtr<SkPicture> SingleThreadProxy::capturePicture() +skia::RefPtr<SkPicture> SingleThreadProxy::CapturePicture() { // Requires impl-side painting, which is only supported in threaded compositing. NOTREACHED(); diff --git a/cc/single_thread_proxy.h b/cc/single_thread_proxy.h index a8be093..e954b85 100644 --- a/cc/single_thread_proxy.h +++ b/cc/single_thread_proxy.h @@ -23,31 +23,31 @@ public: virtual ~SingleThreadProxy(); // Proxy implementation - virtual bool compositeAndReadback(void *pixels, const gfx::Rect&) OVERRIDE; - virtual void startPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnchor, float scale, base::TimeDelta duration) OVERRIDE; - virtual void finishAllRendering() OVERRIDE; - virtual bool isStarted() const OVERRIDE; - virtual bool initializeOutputSurface() OVERRIDE; - virtual void setSurfaceReady() OVERRIDE; - virtual void setVisible(bool) OVERRIDE; - virtual bool initializeRenderer() OVERRIDE; - virtual bool recreateOutputSurface() OVERRIDE; - virtual void renderingStats(RenderingStats*) OVERRIDE; - virtual const RendererCapabilities& rendererCapabilities() const OVERRIDE; - virtual void setNeedsAnimate() OVERRIDE; - virtual void setNeedsCommit() OVERRIDE; - virtual void setNeedsRedraw() OVERRIDE; - virtual void setDeferCommits(bool) OVERRIDE; - virtual bool commitRequested() const OVERRIDE; - virtual void mainThreadHasStoppedFlinging() OVERRIDE { } - virtual void start() OVERRIDE; - virtual void stop() OVERRIDE; - virtual size_t maxPartialTextureUpdates() const OVERRIDE; - virtual void acquireLayerTextures() OVERRIDE { } - virtual void forceSerializeOnSwapBuffers() OVERRIDE; - virtual skia::RefPtr<SkPicture> capturePicture() OVERRIDE; - virtual scoped_ptr<base::Value> asValue() const OVERRIDE; - virtual bool commitPendingForTesting() OVERRIDE; + virtual bool CompositeAndReadback(void* pixels, gfx::Rect rect) OVERRIDE; + virtual void StartPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnchor, float scale, base::TimeDelta duration) OVERRIDE; + virtual void FinishAllRendering() OVERRIDE; + virtual bool IsStarted() const OVERRIDE; + virtual bool InitializeOutputSurface() OVERRIDE; + virtual void SetSurfaceReady() OVERRIDE; + virtual void SetVisible(bool) OVERRIDE; + virtual bool InitializeRenderer() OVERRIDE; + virtual bool RecreateOutputSurface() OVERRIDE; + virtual void GetRenderingStats(RenderingStats*) OVERRIDE; + virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE; + virtual void SetNeedsAnimate() OVERRIDE; + virtual void SetNeedsCommit() OVERRIDE; + virtual void SetNeedsRedraw() OVERRIDE; + virtual void SetDeferCommits(bool) OVERRIDE; + virtual bool CommitRequested() const OVERRIDE; + virtual void MainThreadHasStoppedFlinging() OVERRIDE { } + virtual void Start() OVERRIDE; + virtual void Stop() OVERRIDE; + virtual size_t MaxPartialTextureUpdates() const OVERRIDE; + virtual void AcquireLayerTextures() OVERRIDE { } + virtual void ForceSerializeOnSwapBuffers() OVERRIDE; + virtual skia::RefPtr<SkPicture> CapturePicture() OVERRIDE; + virtual scoped_ptr<base::Value> AsValue() const OVERRIDE; + virtual bool CommitPendingForTesting() OVERRIDE; // LayerTreeHostImplClient implementation virtual void didLoseOutputSurfaceOnImplThread() OVERRIDE; @@ -82,7 +82,7 @@ private: bool m_outputSurfaceLost; bool m_createdOffscreenContextProvider; - // Holds on to the context between initializeContext() and initializeRenderer() calls. Shouldn't + // Holds on to the context between initializeContext() and InitializeRenderer() calls. Shouldn't // be used for anything else. scoped_ptr<OutputSurface> m_outputSurfaceBeforeInitialization; @@ -104,22 +104,22 @@ private: class DebugScopedSetImplThread { public: explicit DebugScopedSetImplThread(Proxy* proxy) - : m_proxy(proxy) + : proxy_(proxy) { #ifndef NDEBUG - m_previousValue = m_proxy->m_implThreadIsOverridden; - m_proxy->setCurrentThreadIsImplThread(true); + m_previousValue = proxy_->impl_thread_is_overridden_; + proxy_->SetCurrentThreadIsImplThread(true); #endif } ~DebugScopedSetImplThread() { #ifndef NDEBUG - m_proxy->setCurrentThreadIsImplThread(m_previousValue); + proxy_->SetCurrentThreadIsImplThread(m_previousValue); #endif } private: bool m_previousValue; - Proxy* m_proxy; + Proxy* proxy_; }; // For use in the single-threaded case. In debug builds, it pretends that the @@ -127,22 +127,22 @@ private: class DebugScopedSetMainThread { public: explicit DebugScopedSetMainThread(Proxy* proxy) - : m_proxy(proxy) + : proxy_(proxy) { #ifndef NDEBUG - m_previousValue = m_proxy->m_implThreadIsOverridden; - m_proxy->setCurrentThreadIsImplThread(false); + m_previousValue = proxy_->impl_thread_is_overridden_; + proxy_->SetCurrentThreadIsImplThread(false); #endif } ~DebugScopedSetMainThread() { #ifndef NDEBUG - m_proxy->setCurrentThreadIsImplThread(m_previousValue); + proxy_->SetCurrentThreadIsImplThread(m_previousValue); #endif } private: bool m_previousValue; - Proxy* m_proxy; + Proxy* proxy_; }; // For use in the single-threaded case. In debug builds, it pretends that the @@ -151,12 +151,12 @@ private: class DebugScopedSetImplThreadAndMainThreadBlocked { public: explicit DebugScopedSetImplThreadAndMainThreadBlocked(Proxy* proxy) - : m_implThread(proxy) + : impl_thread_(proxy) , m_mainThreadBlocked(proxy) { } private: - DebugScopedSetImplThread m_implThread; + DebugScopedSetImplThread impl_thread_; DebugScopedSetMainThreadBlocked m_mainThreadBlocked; }; diff --git a/cc/test/fake_proxy.cc b/cc/test/fake_proxy.cc index f8587ef..b4cf9ad 100644 --- a/cc/test/fake_proxy.cc +++ b/cc/test/fake_proxy.cc @@ -6,47 +6,47 @@ namespace cc { -bool FakeProxy::compositeAndReadback(void *pixels, const gfx::Rect&) +bool FakeProxy::CompositeAndReadback(void* pixels, gfx::Rect rect) { return true; } -bool FakeProxy::isStarted() const +bool FakeProxy::IsStarted() const { return true; } -bool FakeProxy::initializeOutputSurface() +bool FakeProxy::InitializeOutputSurface() { return true; } -bool FakeProxy::initializeRenderer() +bool FakeProxy::InitializeRenderer() { return true; } -bool FakeProxy::recreateOutputSurface() +bool FakeProxy::RecreateOutputSurface() { return true; } -const RendererCapabilities& FakeProxy::rendererCapabilities() const +const RendererCapabilities& FakeProxy::GetRendererCapabilities() const { return m_capabilities; } -RendererCapabilities& FakeProxy::rendererCapabilities() +RendererCapabilities& FakeProxy::GetRendererCapabilities() { return m_capabilities; } -bool FakeProxy::commitRequested() const +bool FakeProxy::CommitRequested() const { return false; } -size_t FakeProxy::maxPartialTextureUpdates() const +size_t FakeProxy::MaxPartialTextureUpdates() const { return m_maxPartialTextureUpdates; } @@ -56,17 +56,17 @@ void FakeProxy::setMaxPartialTextureUpdates(size_t max) m_maxPartialTextureUpdates = max; } -bool FakeProxy::commitPendingForTesting() +bool FakeProxy::CommitPendingForTesting() { return false; } -skia::RefPtr<SkPicture> FakeProxy::capturePicture() +skia::RefPtr<SkPicture> FakeProxy::CapturePicture() { return skia::RefPtr<SkPicture>(); } -scoped_ptr<base::Value> FakeProxy::asValue() const { +scoped_ptr<base::Value> FakeProxy::AsValue() const { scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); return state.PassAs<base::Value>(); } diff --git a/cc/test/fake_proxy.h b/cc/test/fake_proxy.h index a74e303..f3f9135 100644 --- a/cc/test/fake_proxy.h +++ b/cc/test/fake_proxy.h @@ -15,33 +15,33 @@ class FakeProxy : public Proxy { public: explicit FakeProxy(scoped_ptr<Thread> implThread) : Proxy(implThread.Pass()) { } - virtual bool compositeAndReadback(void *pixels, const gfx::Rect&) OVERRIDE; - virtual void startPageScaleAnimation(gfx::Vector2d targetPosition, bool useAnchor, float scale, base::TimeDelta duration) OVERRIDE { } - virtual void finishAllRendering() OVERRIDE { } - virtual bool isStarted() const OVERRIDE; - virtual bool initializeOutputSurface() OVERRIDE; - virtual void setSurfaceReady() OVERRIDE { } - virtual void setVisible(bool) OVERRIDE { } - virtual bool initializeRenderer() OVERRIDE; - virtual bool recreateOutputSurface() OVERRIDE; - virtual void renderingStats(RenderingStats*) OVERRIDE { } - virtual const RendererCapabilities& rendererCapabilities() const OVERRIDE; - virtual void setNeedsAnimate() OVERRIDE { } - virtual void setNeedsCommit() OVERRIDE { } - virtual void setNeedsRedraw() OVERRIDE { } - virtual void setDeferCommits(bool) OVERRIDE { } - virtual void mainThreadHasStoppedFlinging() OVERRIDE { } - virtual bool commitRequested() const OVERRIDE; - virtual void start() OVERRIDE { } - virtual void stop() OVERRIDE { } - virtual void forceSerializeOnSwapBuffers() OVERRIDE { } - virtual size_t maxPartialTextureUpdates() const OVERRIDE; - virtual void acquireLayerTextures() OVERRIDE { } - virtual bool commitPendingForTesting() OVERRIDE; - virtual skia::RefPtr<SkPicture> capturePicture() OVERRIDE; - virtual scoped_ptr<base::Value> asValue() const OVERRIDE; - - virtual RendererCapabilities& rendererCapabilities(); + virtual bool CompositeAndReadback(void* pixels, gfx::Rect rect) OVERRIDE; + virtual void StartPageScaleAnimation(gfx::Vector2d targetPosition, bool useAnchor, float scale, base::TimeDelta duration) OVERRIDE { } + virtual void FinishAllRendering() OVERRIDE { } + virtual bool IsStarted() const OVERRIDE; + virtual bool InitializeOutputSurface() OVERRIDE; + virtual void SetSurfaceReady() OVERRIDE { } + virtual void SetVisible(bool) OVERRIDE { } + virtual bool InitializeRenderer() OVERRIDE; + virtual bool RecreateOutputSurface() OVERRIDE; + virtual void GetRenderingStats(RenderingStats*) OVERRIDE { } + virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE; + virtual void SetNeedsAnimate() OVERRIDE { } + virtual void SetNeedsCommit() OVERRIDE { } + virtual void SetNeedsRedraw() OVERRIDE { } + virtual void SetDeferCommits(bool) OVERRIDE { } + virtual void MainThreadHasStoppedFlinging() OVERRIDE { } + virtual bool CommitRequested() const OVERRIDE; + virtual void Start() OVERRIDE { } + virtual void Stop() OVERRIDE { } + virtual void ForceSerializeOnSwapBuffers() OVERRIDE { } + virtual size_t MaxPartialTextureUpdates() const OVERRIDE; + virtual void AcquireLayerTextures() OVERRIDE { } + virtual bool CommitPendingForTesting() OVERRIDE; + virtual skia::RefPtr<SkPicture> CapturePicture() OVERRIDE; + virtual scoped_ptr<base::Value> AsValue() const OVERRIDE; + + virtual RendererCapabilities& GetRendererCapabilities(); void setMaxPartialTextureUpdates(size_t); private: diff --git a/cc/test/layer_tree_test_common.cc b/cc/test/layer_tree_test_common.cc index 14d7c2f..f7cbb35 100644 --- a/cc/test/layer_tree_test_common.cc +++ b/cc/test/layer_tree_test_common.cc @@ -314,42 +314,42 @@ void ThreadedTest::endTest() if (m_beginning) m_endWhenBeginReturns = true; else - proxy()->mainThread()->postTask(base::Bind(&ThreadedTest::realEndTest, m_mainThreadWeakPtr)); + proxy()->MainThread()->postTask(base::Bind(&ThreadedTest::realEndTest, m_mainThreadWeakPtr)); } void ThreadedTest::endTestAfterDelay(int delayMilliseconds) { - proxy()->mainThread()->postTask(base::Bind(&ThreadedTest::endTest, m_mainThreadWeakPtr)); + proxy()->MainThread()->postTask(base::Bind(&ThreadedTest::endTest, m_mainThreadWeakPtr)); } void ThreadedTest::postAddAnimationToMainThread(Layer* layerToReceiveAnimation) { - proxy()->mainThread()->postTask(base::Bind(&ThreadedTest::dispatchAddAnimation, m_mainThreadWeakPtr, base::Unretained(layerToReceiveAnimation))); + proxy()->MainThread()->postTask(base::Bind(&ThreadedTest::dispatchAddAnimation, m_mainThreadWeakPtr, base::Unretained(layerToReceiveAnimation))); } void ThreadedTest::postAddInstantAnimationToMainThread() { - proxy()->mainThread()->postTask(base::Bind(&ThreadedTest::dispatchAddInstantAnimation, m_mainThreadWeakPtr)); + proxy()->MainThread()->postTask(base::Bind(&ThreadedTest::dispatchAddInstantAnimation, m_mainThreadWeakPtr)); } void ThreadedTest::postSetNeedsCommitToMainThread() { - proxy()->mainThread()->postTask(base::Bind(&ThreadedTest::dispatchSetNeedsCommit, m_mainThreadWeakPtr)); + proxy()->MainThread()->postTask(base::Bind(&ThreadedTest::dispatchSetNeedsCommit, m_mainThreadWeakPtr)); } void ThreadedTest::postAcquireLayerTextures() { - proxy()->mainThread()->postTask(base::Bind(&ThreadedTest::dispatchAcquireLayerTextures, m_mainThreadWeakPtr)); + proxy()->MainThread()->postTask(base::Bind(&ThreadedTest::dispatchAcquireLayerTextures, m_mainThreadWeakPtr)); } void ThreadedTest::postSetNeedsRedrawToMainThread() { - proxy()->mainThread()->postTask(base::Bind(&ThreadedTest::dispatchSetNeedsRedraw, m_mainThreadWeakPtr)); + proxy()->MainThread()->postTask(base::Bind(&ThreadedTest::dispatchSetNeedsRedraw, m_mainThreadWeakPtr)); } void ThreadedTest::postSetVisibleToMainThread(bool visible) { - proxy()->mainThread()->postTask(base::Bind(&ThreadedTest::dispatchSetVisible, m_mainThreadWeakPtr, visible)); + proxy()->MainThread()->postTask(base::Bind(&ThreadedTest::dispatchSetVisible, m_mainThreadWeakPtr, visible)); } void ThreadedTest::doBeginTest() @@ -402,15 +402,15 @@ void ThreadedTest::scheduleComposite() if (!m_started || m_scheduled) return; m_scheduled = true; - proxy()->mainThread()->postTask(base::Bind(&ThreadedTest::dispatchComposite, m_mainThreadWeakPtr)); + proxy()->MainThread()->postTask(base::Bind(&ThreadedTest::dispatchComposite, m_mainThreadWeakPtr)); } void ThreadedTest::realEndTest() { m_ended = true; - if (m_layerTreeHost && proxy()->commitPendingForTesting()) { - proxy()->mainThread()->postTask(base::Bind(&ThreadedTest::realEndTest, m_mainThreadWeakPtr)); + if (m_layerTreeHost && proxy()->CommitPendingForTesting()) { + proxy()->MainThread()->postTask(base::Bind(&ThreadedTest::realEndTest, m_mainThreadWeakPtr)); return; } @@ -419,7 +419,7 @@ void ThreadedTest::realEndTest() void ThreadedTest::dispatchAddInstantAnimation() { - DCHECK(!proxy() || proxy()->isMainThread()); + DCHECK(!proxy() || proxy()->IsMainThread()); if (m_layerTreeHost.get() && m_layerTreeHost->rootLayer()) addOpacityTransitionToLayer(*m_layerTreeHost->rootLayer(), 0, 0, 0.5, false); @@ -427,7 +427,7 @@ void ThreadedTest::dispatchAddInstantAnimation() void ThreadedTest::dispatchAddAnimation(Layer* layerToReceiveAnimation) { - DCHECK(!proxy() || proxy()->isMainThread()); + DCHECK(!proxy() || proxy()->IsMainThread()); if (layerToReceiveAnimation) addOpacityTransitionToLayer(*layerToReceiveAnimation, 10, 0, 0.5, true); @@ -435,7 +435,7 @@ void ThreadedTest::dispatchAddAnimation(Layer* layerToReceiveAnimation) void ThreadedTest::dispatchSetNeedsCommit() { - DCHECK(!proxy() || proxy()->isMainThread()); + DCHECK(!proxy() || proxy()->IsMainThread()); if (m_layerTreeHost.get()) m_layerTreeHost->setNeedsCommit(); @@ -443,7 +443,7 @@ void ThreadedTest::dispatchSetNeedsCommit() void ThreadedTest::dispatchAcquireLayerTextures() { - DCHECK(!proxy() || proxy()->isMainThread()); + DCHECK(!proxy() || proxy()->IsMainThread()); if (m_layerTreeHost.get()) m_layerTreeHost->acquireLayerTextures(); @@ -451,7 +451,7 @@ void ThreadedTest::dispatchAcquireLayerTextures() void ThreadedTest::dispatchSetNeedsRedraw() { - DCHECK(!proxy() || proxy()->isMainThread()); + DCHECK(!proxy() || proxy()->IsMainThread()); if (m_layerTreeHost.get()) m_layerTreeHost->setNeedsRedraw(); @@ -459,7 +459,7 @@ void ThreadedTest::dispatchSetNeedsRedraw() void ThreadedTest::dispatchSetVisible(bool visible) { - DCHECK(!proxy() || proxy()->isMainThread()); + DCHECK(!proxy() || proxy()->IsMainThread()); if (!m_layerTreeHost) return; diff --git a/cc/test/layer_tree_test_common.h b/cc/test/layer_tree_test_common.h index 69c004e..6a61a11 100644 --- a/cc/test/layer_tree_test_common.h +++ b/cc/test/layer_tree_test_common.h @@ -125,7 +125,7 @@ protected: virtual void runTest(bool threaded); - Thread* implThread() { return proxy() ? proxy()->implThread() : 0; } + Thread* ImplThread() { return proxy() ? proxy()->ImplThread() : 0; } Proxy* proxy() const { return m_layerTreeHost ? m_layerTreeHost->proxy() : 0; } LayerTreeSettings m_settings; diff --git a/cc/texture_layer.cc b/cc/texture_layer.cc index 0381782..2aa894c 100644 --- a/cc/texture_layer.cc +++ b/cc/texture_layer.cc @@ -184,7 +184,7 @@ void TextureLayer::pushPropertiesTo(LayerImpl* layer) textureLayer->setVertexOpacity(m_vertexOpacity); textureLayer->setPremultipliedAlpha(m_premultipliedAlpha); if (m_usesMailbox && m_ownMailbox) { - Thread* mainThread = layerTreeHost()->proxy()->mainThread(); + Thread* mainThread = layerTreeHost()->proxy()->MainThread(); TextureMailbox::ReleaseCallback callback; if (!m_textureMailbox.IsEmpty()) callback = base::Bind(&postCallbackToMainThread, mainThread, m_textureMailbox.callback()); diff --git a/cc/texture_layer_unittest.cc b/cc/texture_layer_unittest.cc index 3a419c7c..db63c47 100644 --- a/cc/texture_layer_unittest.cc +++ b/cc/texture_layer_unittest.cc @@ -288,7 +288,7 @@ public: // Make sure callback is received on main and doesn't block the impl thread. void releaseCallback(unsigned syncPoint) { - EXPECT_EQ(true, proxy()->isMainThread()); + EXPECT_EQ(true, proxy()->IsMainThread()); ++m_callbackCount; } diff --git a/cc/thread_proxy.cc b/cc/thread_proxy.cc index 86f10ae4..139eddc 100644 --- a/cc/thread_proxy.cc +++ b/cc/thread_proxy.cc @@ -63,20 +63,20 @@ ThreadProxy::ThreadProxy(LayerTreeHost* layerTreeHost, scoped_ptr<Thread> implTh , m_renewTreePriorityOnImplThreadPending(false) { TRACE_EVENT0("cc", "ThreadProxy::ThreadProxy"); - DCHECK(isMainThread()); + DCHECK(IsMainThread()); } ThreadProxy::~ThreadProxy() { TRACE_EVENT0("cc", "ThreadProxy::~ThreadProxy"); - DCHECK(isMainThread()); + DCHECK(IsMainThread()); DCHECK(!m_started); } -bool ThreadProxy::compositeAndReadback(void *pixels, const gfx::Rect& rect) +bool ThreadProxy::CompositeAndReadback(void* pixels, gfx::Rect rect) { TRACE_EVENT0("cc", "ThreadProxy::compositeAndReadback"); - DCHECK(isMainThread()); + DCHECK(IsMainThread()); DCHECK(m_layerTreeHost); DCHECK(!m_deferCommits); @@ -90,7 +90,7 @@ bool ThreadProxy::compositeAndReadback(void *pixels, const gfx::Rect& rect) { DebugScopedSetMainThreadBlocked mainThreadBlocked(this); CompletionEvent beginFrameCompletion; - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::forceBeginFrameOnImplThread, m_implThreadWeakPtr, &beginFrameCompletion)); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::forceBeginFrameOnImplThread, m_implThreadWeakPtr, &beginFrameCompletion)); beginFrameCompletion.wait(); } m_inCompositeAndReadback = true; @@ -103,7 +103,7 @@ bool ThreadProxy::compositeAndReadback(void *pixels, const gfx::Rect& rect) request.pixels = pixels; { DebugScopedSetMainThreadBlocked mainThreadBlocked(this); - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::requestReadbackOnImplThread, m_implThreadWeakPtr, &request)); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::requestReadbackOnImplThread, m_implThreadWeakPtr, &request)); request.completion.wait(); } return request.success; @@ -111,7 +111,7 @@ bool ThreadProxy::compositeAndReadback(void *pixels, const gfx::Rect& rect) void ThreadProxy::requestReadbackOnImplThread(ReadbackRequest* request) { - DCHECK(Proxy::isImplThread()); + DCHECK(Proxy::IsImplThread()); DCHECK(!m_readbackRequestOnImplThread); if (!m_layerTreeHostImpl.get()) { request->success = false; @@ -124,52 +124,52 @@ void ThreadProxy::requestReadbackOnImplThread(ReadbackRequest* request) m_schedulerOnImplThread->setNeedsForcedRedraw(); } -void ThreadProxy::startPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnchor, float scale, base::TimeDelta duration) +void ThreadProxy::StartPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnchor, float scale, base::TimeDelta duration) { - DCHECK(Proxy::isMainThread()); - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::requestStartPageScaleAnimationOnImplThread, m_implThreadWeakPtr, targetOffset, useAnchor, scale, duration)); + DCHECK(Proxy::IsMainThread()); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::requestStartPageScaleAnimationOnImplThread, m_implThreadWeakPtr, targetOffset, useAnchor, scale, duration)); } void ThreadProxy::requestStartPageScaleAnimationOnImplThread(gfx::Vector2d targetOffset, bool useAnchor, float scale, base::TimeDelta duration) { - DCHECK(Proxy::isImplThread()); + DCHECK(Proxy::IsImplThread()); if (m_layerTreeHostImpl.get()) m_layerTreeHostImpl->startPageScaleAnimation(targetOffset, useAnchor, scale, base::TimeTicks::Now(), duration); } -void ThreadProxy::finishAllRendering() +void ThreadProxy::FinishAllRendering() { - DCHECK(Proxy::isMainThread()); + DCHECK(Proxy::IsMainThread()); DCHECK(!m_deferCommits); // Make sure all GL drawing is finished on the impl thread. DebugScopedSetMainThreadBlocked mainThreadBlocked(this); CompletionEvent completion; - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::finishAllRenderingOnImplThread, m_implThreadWeakPtr, &completion)); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::finishAllRenderingOnImplThread, m_implThreadWeakPtr, &completion)); completion.wait(); } -bool ThreadProxy::isStarted() const +bool ThreadProxy::IsStarted() const { - DCHECK(Proxy::isMainThread()); + DCHECK(Proxy::IsMainThread()); return m_started; } -bool ThreadProxy::initializeOutputSurface() +bool ThreadProxy::InitializeOutputSurface() { TRACE_EVENT0("cc", "ThreadProxy::initializeOutputSurface"); scoped_ptr<OutputSurface> context = m_layerTreeHost->createOutputSurface(); if (!context.get()) return false; - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::initializeOutputSurfaceOnImplThread, m_implThreadWeakPtr, base::Passed(&context))); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::initializeOutputSurfaceOnImplThread, m_implThreadWeakPtr, base::Passed(&context))); return true; } -void ThreadProxy::setSurfaceReady() +void ThreadProxy::SetSurfaceReady() { TRACE_EVENT0("cc", "ThreadProxy::setSurfaceReady"); - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::setSurfaceReadyOnImplThread, m_implThreadWeakPtr)); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::setSurfaceReadyOnImplThread, m_implThreadWeakPtr)); } void ThreadProxy::setSurfaceReadyOnImplThread() @@ -178,12 +178,12 @@ void ThreadProxy::setSurfaceReadyOnImplThread() m_schedulerOnImplThread->setCanBeginFrame(true); } -void ThreadProxy::setVisible(bool visible) +void ThreadProxy::SetVisible(bool visible) { TRACE_EVENT0("cc", "ThreadProxy::setVisible"); DebugScopedSetMainThreadBlocked mainThreadBlocked(this); CompletionEvent completion; - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::setVisibleOnImplThread, m_implThreadWeakPtr, &completion, visible)); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::setVisibleOnImplThread, m_implThreadWeakPtr, &completion, visible)); completion.wait(); } @@ -195,7 +195,7 @@ void ThreadProxy::setVisibleOnImplThread(CompletionEvent* completion, bool visib completion->signal(); } -bool ThreadProxy::initializeRenderer() +bool ThreadProxy::InitializeRenderer() { TRACE_EVENT0("cc", "ThreadProxy::initializeRenderer"); // Make a blocking call to initializeRendererOnImplThread. The results of that call @@ -204,7 +204,7 @@ bool ThreadProxy::initializeRenderer() bool initializeSucceeded = false; RendererCapabilities capabilities; DebugScopedSetMainThreadBlocked mainThreadBlocked(this); - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::initializeRendererOnImplThread, + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::initializeRendererOnImplThread, m_implThreadWeakPtr, &completion, &initializeSucceeded, @@ -218,10 +218,10 @@ bool ThreadProxy::initializeRenderer() return initializeSucceeded; } -bool ThreadProxy::recreateOutputSurface() +bool ThreadProxy::RecreateOutputSurface() { TRACE_EVENT0("cc", "ThreadProxy::recreateOutputSurface"); - DCHECK(isMainThread()); + DCHECK(IsMainThread()); // Try to create the surface. scoped_ptr<OutputSurface> outputSurface = m_layerTreeHost->createOutputSurface(); @@ -241,7 +241,7 @@ bool ThreadProxy::recreateOutputSurface() bool recreateSucceeded = false; RendererCapabilities capabilities; DebugScopedSetMainThreadBlocked mainThreadBlocked(this); - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::recreateOutputSurfaceOnImplThread, + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::recreateOutputSurfaceOnImplThread, m_implThreadWeakPtr, &completion, base::Passed(&outputSurface), @@ -255,13 +255,13 @@ bool ThreadProxy::recreateOutputSurface() return recreateSucceeded; } -void ThreadProxy::renderingStats(RenderingStats* stats) +void ThreadProxy::GetRenderingStats(RenderingStats* stats) { - DCHECK(isMainThread()); + DCHECK(IsMainThread()); DebugScopedSetMainThreadBlocked mainThreadBlocked(this); CompletionEvent completion; - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::renderingStatsOnImplThread, + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::renderingStatsOnImplThread, m_implThreadWeakPtr, &completion, stats)); stats->totalCommitTime = m_totalCommitTime; stats->totalCommitCount = m_totalCommitCount; @@ -269,15 +269,15 @@ void ThreadProxy::renderingStats(RenderingStats* stats) completion.wait(); } -const RendererCapabilities& ThreadProxy::rendererCapabilities() const +const RendererCapabilities& ThreadProxy::GetRendererCapabilities() const { DCHECK(m_rendererInitialized); return m_RendererCapabilitiesMainThreadCopy; } -void ThreadProxy::setNeedsAnimate() +void ThreadProxy::SetNeedsAnimate() { - DCHECK(isMainThread()); + DCHECK(IsMainThread()); if (m_animateRequested) return; @@ -287,12 +287,12 @@ void ThreadProxy::setNeedsAnimate() if (m_commitRequestSentToImplThread) return; m_commitRequestSentToImplThread = true; - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::setNeedsCommitOnImplThread, m_implThreadWeakPtr)); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::setNeedsCommitOnImplThread, m_implThreadWeakPtr)); } -void ThreadProxy::setNeedsCommit() +void ThreadProxy::SetNeedsCommit() { - DCHECK(isMainThread()); + DCHECK(IsMainThread()); if (m_commitRequested) return; TRACE_EVENT0("cc", "ThreadProxy::setNeedsCommit"); @@ -301,19 +301,19 @@ void ThreadProxy::setNeedsCommit() if (m_commitRequestSentToImplThread) return; m_commitRequestSentToImplThread = true; - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::setNeedsCommitOnImplThread, m_implThreadWeakPtr)); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::setNeedsCommitOnImplThread, m_implThreadWeakPtr)); } void ThreadProxy::didLoseOutputSurfaceOnImplThread() { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::didLoseOutputSurfaceOnImplThread"); - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::checkOutputSurfaceStatusOnImplThread, m_implThreadWeakPtr)); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::checkOutputSurfaceStatusOnImplThread, m_implThreadWeakPtr)); } void ThreadProxy::checkOutputSurfaceStatusOnImplThread() { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::checkOutputSurfaceStatusOnImplThread"); if (!m_layerTreeHostImpl->isContextLost()) return; @@ -324,36 +324,36 @@ void ThreadProxy::checkOutputSurfaceStatusOnImplThread() void ThreadProxy::onSwapBuffersCompleteOnImplThread() { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::onSwapBuffersCompleteOnImplThread"); m_schedulerOnImplThread->didSwapBuffersComplete(); - Proxy::mainThread()->postTask(base::Bind(&ThreadProxy::didCompleteSwapBuffers, m_mainThreadWeakPtr)); + Proxy::MainThread()->postTask(base::Bind(&ThreadProxy::didCompleteSwapBuffers, m_mainThreadWeakPtr)); } void ThreadProxy::onVSyncParametersChanged(base::TimeTicks timebase, base::TimeDelta interval) { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); TRACE_EVENT2("cc", "ThreadProxy::onVSyncParametersChanged", "timebase", (timebase - base::TimeTicks()).InMilliseconds(), "interval", interval.InMilliseconds()); m_schedulerOnImplThread->setTimebaseAndInterval(timebase, interval); } void ThreadProxy::onCanDrawStateChanged(bool canDraw) { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); TRACE_EVENT1("cc", "ThreadProxy::onCanDrawStateChanged", "canDraw", canDraw); m_schedulerOnImplThread->setCanDraw(canDraw); } void ThreadProxy::onHasPendingTreeStateChanged(bool hasPendingTree) { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); TRACE_EVENT1("cc", "ThreadProxy::onHasPendingTreeStateChanged", "hasPendingTree", hasPendingTree); m_schedulerOnImplThread->setHasPendingTree(hasPendingTree); } void ThreadProxy::setNeedsCommitOnImplThread() { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::setNeedsCommitOnImplThread"); m_schedulerOnImplThread->setNeedsCommit(); } @@ -362,7 +362,7 @@ void ThreadProxy::setNeedsManageTilesOnImplThread() { if (m_manageTilesPending) return; - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::manageTilesOnImplThread, m_implThreadWeakPtr)); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::manageTilesOnImplThread, m_implThreadWeakPtr)); m_manageTilesPending = true; } @@ -376,21 +376,21 @@ void ThreadProxy::manageTilesOnImplThread() void ThreadProxy::setNeedsForcedCommitOnImplThread() { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::setNeedsForcedCommitOnImplThread"); m_schedulerOnImplThread->setNeedsForcedCommit(); } void ThreadProxy::postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector> events, base::Time wallClockTime) { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::postAnimationEventsToMainThreadOnImplThread"); - Proxy::mainThread()->postTask(base::Bind(&ThreadProxy::setAnimationEvents, m_mainThreadWeakPtr, base::Passed(&events), wallClockTime)); + Proxy::MainThread()->postTask(base::Bind(&ThreadProxy::setAnimationEvents, m_mainThreadWeakPtr, base::Passed(&events), wallClockTime)); } bool ThreadProxy::reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int priorityCutoff) { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); if (!m_layerTreeHost->contentsTextureManager()) return false; @@ -408,7 +408,7 @@ bool ThreadProxy::reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int void ThreadProxy::reduceWastedContentsTextureMemoryOnImplThread() { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); if (!m_layerTreeHost->contentsTextureManager()) return; @@ -418,7 +418,7 @@ void ThreadProxy::reduceWastedContentsTextureMemoryOnImplThread() void ThreadProxy::sendManagedMemoryStats() { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); if (!m_layerTreeHostImpl.get()) return; if (!m_layerTreeHost->contentsTextureManager()) @@ -441,17 +441,17 @@ bool ThreadProxy::isInsideDraw() return m_insideDraw; } -void ThreadProxy::setNeedsRedraw() +void ThreadProxy::SetNeedsRedraw() { - DCHECK(isMainThread()); + DCHECK(IsMainThread()); TRACE_EVENT0("cc", "ThreadProxy::setNeedsRedraw"); - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::setFullRootLayerDamageOnImplThread, m_implThreadWeakPtr)); - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::setNeedsRedrawOnImplThread, m_implThreadWeakPtr)); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::setFullRootLayerDamageOnImplThread, m_implThreadWeakPtr)); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::setNeedsRedrawOnImplThread, m_implThreadWeakPtr)); } -void ThreadProxy::setDeferCommits(bool deferCommits) +void ThreadProxy::SetDeferCommits(bool deferCommits) { - DCHECK(isMainThread()); + DCHECK(IsMainThread()); DCHECK_NE(m_deferCommits, deferCommits); m_deferCommits = deferCommits; @@ -461,51 +461,51 @@ void ThreadProxy::setDeferCommits(bool deferCommits) TRACE_EVENT_ASYNC_END0("cc", "ThreadProxy::setDeferCommits", this); if (!m_deferCommits && m_pendingDeferredCommit) - Proxy::mainThread()->postTask(base::Bind(&ThreadProxy::beginFrame, m_mainThreadWeakPtr, base::Passed(&m_pendingDeferredCommit))); + Proxy::MainThread()->postTask(base::Bind(&ThreadProxy::beginFrame, m_mainThreadWeakPtr, base::Passed(&m_pendingDeferredCommit))); } -bool ThreadProxy::commitRequested() const +bool ThreadProxy::CommitRequested() const { - DCHECK(isMainThread()); + DCHECK(IsMainThread()); return m_commitRequested; } void ThreadProxy::setNeedsRedrawOnImplThread() { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::setNeedsRedrawOnImplThread"); m_schedulerOnImplThread->setNeedsRedraw(); } void ThreadProxy::didSwapUseIncompleteTileOnImplThread() { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::didSwapUseIncompleteTileOnImplThread"); m_schedulerOnImplThread->didSwapUseIncompleteTile(); } void ThreadProxy::didUploadVisibleHighResolutionTileOnImplThread() { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::didUploadVisibleHighResolutionTileOnImplThread"); m_schedulerOnImplThread->setNeedsRedraw(); } -void ThreadProxy::mainThreadHasStoppedFlinging() +void ThreadProxy::MainThreadHasStoppedFlinging() { if (m_inputHandlerOnImplThread) m_inputHandlerOnImplThread->mainThreadHasStoppedFlinging(); } -void ThreadProxy::start() +void ThreadProxy::Start() { - DCHECK(isMainThread()); - DCHECK(Proxy::implThread()); + DCHECK(IsMainThread()); + DCHECK(Proxy::ImplThread()); // Create LayerTreeHostImpl. DebugScopedSetMainThreadBlocked mainThreadBlocked(this); CompletionEvent completion; scoped_ptr<InputHandler> handler = m_layerTreeHost->createInputHandler(); - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::initializeImplOnImplThread, base::Unretained(this), &completion, handler.release())); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::initializeImplOnImplThread, base::Unretained(this), &completion, handler.release())); completion.wait(); m_mainThreadWeakPtr = m_weakFactory.GetWeakPtr(); @@ -513,10 +513,10 @@ void ThreadProxy::start() m_started = true; } -void ThreadProxy::stop() +void ThreadProxy::Stop() { TRACE_EVENT0("cc", "ThreadProxy::stop"); - DCHECK(isMainThread()); + DCHECK(IsMainThread()); DCHECK(m_started); // Synchronously deletes the impl. @@ -524,7 +524,7 @@ void ThreadProxy::stop() DebugScopedSetMainThreadBlocked mainThreadBlocked(this); CompletionEvent completion; - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::layerTreeHostClosedOnImplThread, m_implThreadWeakPtr, &completion)); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::layerTreeHostClosedOnImplThread, m_implThreadWeakPtr, &completion)); completion.wait(); } @@ -535,11 +535,11 @@ void ThreadProxy::stop() m_started = false; } -void ThreadProxy::forceSerializeOnSwapBuffers() +void ThreadProxy::ForceSerializeOnSwapBuffers() { DebugScopedSetMainThreadBlocked mainThreadBlocked(this); CompletionEvent completion; - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::forceSerializeOnSwapBuffersOnImplThread, m_implThreadWeakPtr, &completion)); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::forceSerializeOnSwapBuffersOnImplThread, m_implThreadWeakPtr, &completion)); completion.wait(); } @@ -554,7 +554,7 @@ void ThreadProxy::forceSerializeOnSwapBuffersOnImplThread(CompletionEvent* compl void ThreadProxy::finishAllRenderingOnImplThread(CompletionEvent* completion) { TRACE_EVENT0("cc", "ThreadProxy::finishAllRenderingOnImplThread"); - DCHECK(isImplThread()); + DCHECK(IsImplThread()); m_layerTreeHostImpl->finishAllRendering(); completion->signal(); } @@ -582,7 +582,7 @@ void ThreadProxy::scheduledActionBeginFrame() beginFrameState->implTransform = m_layerTreeHostImpl->activeTree()->ImplTransform(); DCHECK_GT(m_layerTreeHostImpl->memoryAllocationLimitBytes(), 0u); beginFrameState->memoryAllocationLimitBytes = m_layerTreeHostImpl->memoryAllocationLimitBytes(); - Proxy::mainThread()->postTask(base::Bind(&ThreadProxy::beginFrame, m_mainThreadWeakPtr, base::Passed(&beginFrameState))); + Proxy::MainThread()->postTask(base::Bind(&ThreadProxy::beginFrame, m_mainThreadWeakPtr, base::Passed(&beginFrameState))); if (m_beginFrameCompletionEventOnImplThread) { m_beginFrameCompletionEventOnImplThread->signal(); @@ -593,7 +593,7 @@ void ThreadProxy::scheduledActionBeginFrame() void ThreadProxy::beginFrame(scoped_ptr<BeginFrameAndCommitState> beginFrameState) { TRACE_EVENT0("cc", "ThreadProxy::beginFrame"); - DCHECK(isMainThread()); + DCHECK(IsMainThread()); if (!m_layerTreeHost) return; @@ -627,7 +627,7 @@ void ThreadProxy::beginFrame(scoped_ptr<BeginFrameAndCommitState> beginFrameStat m_commitRequestSentToImplThread = false; TRACE_EVENT0("cc", "EarlyOut_NotVisible"); - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::beginFrameAbortedOnImplThread, m_implThreadWeakPtr)); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::beginFrameAbortedOnImplThread, m_implThreadWeakPtr)); return; } @@ -670,7 +670,7 @@ void ThreadProxy::beginFrame(scoped_ptr<BeginFrameAndCommitState> beginFrameStat if (m_animateRequested) { // Forces setNeedsAnimate to consider posting a commit task. m_animateRequested = false; - setNeedsAnimate(); + SetNeedsAnimate(); } scoped_refptr<cc::ContextProvider> offscreenContextProvider; @@ -693,7 +693,7 @@ void ThreadProxy::beginFrame(scoped_ptr<BeginFrameAndCommitState> beginFrameStat base::TimeTicks startTime = base::TimeTicks::HighResNow(); CompletionEvent completion; - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::beginFrameCompleteOnImplThread, m_implThreadWeakPtr, &completion, queue.release(), offscreenContextProvider)); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::beginFrameCompleteOnImplThread, m_implThreadWeakPtr, &completion, queue.release(), offscreenContextProvider)); completion.wait(); base::TimeTicks endTime = base::TimeTicks::HighResNow(); @@ -711,7 +711,7 @@ void ThreadProxy::beginFrameCompleteOnImplThread(CompletionEvent* completion, Re TRACE_EVENT0("cc", "ThreadProxy::beginFrameCompleteOnImplThread"); DCHECK(!m_commitCompletionEventOnImplThread); - DCHECK(isImplThread() && isMainThreadBlocked()); + DCHECK(IsImplThread() && IsMainThreadBlocked()); DCHECK(m_schedulerOnImplThread); DCHECK(m_schedulerOnImplThread->commitPending()); @@ -734,7 +734,7 @@ void ThreadProxy::beginFrameCompleteOnImplThread(CompletionEvent* completion, Re m_layerTreeHost->contentsTextureManager()->pushTexturePrioritiesToBackings(); - m_currentResourceUpdateControllerOnImplThread = ResourceUpdateController::Create(this, Proxy::implThread(), queue.Pass(), m_layerTreeHostImpl->resourceProvider()); + m_currentResourceUpdateControllerOnImplThread = ResourceUpdateController::Create(this, Proxy::ImplThread(), queue.Pass(), m_layerTreeHostImpl->resourceProvider()); m_currentResourceUpdateControllerOnImplThread->PerformMoreUpdates( m_schedulerOnImplThread->anticipatedDrawTime()); @@ -744,7 +744,7 @@ void ThreadProxy::beginFrameCompleteOnImplThread(CompletionEvent* completion, Re void ThreadProxy::beginFrameAbortedOnImplThread() { TRACE_EVENT0("cc", "ThreadProxy::beginFrameAbortedOnImplThread"); - DCHECK(isImplThread()); + DCHECK(IsImplThread()); DCHECK(m_schedulerOnImplThread); DCHECK(m_schedulerOnImplThread->commitPending()); @@ -754,7 +754,7 @@ void ThreadProxy::beginFrameAbortedOnImplThread() void ThreadProxy::scheduledActionCommit() { TRACE_EVENT0("cc", "ThreadProxy::scheduledActionCommit"); - DCHECK(isImplThread()); + DCHECK(IsImplThread()); DCHECK(m_commitCompletionEventOnImplThread); DCHECK(m_currentResourceUpdateControllerOnImplThread); @@ -789,22 +789,22 @@ void ThreadProxy::scheduledActionCommit() void ThreadProxy::scheduledActionCheckForCompletedTileUploads() { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::scheduledActionCheckForCompletedTileUploads"); m_layerTreeHostImpl->checkForCompletedTileUploads(); } void ThreadProxy::scheduledActionActivatePendingTreeIfNeeded() { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::scheduledActionActivatePendingTreeIfNeeded"); m_layerTreeHostImpl->activatePendingTreeIfNeeded(); } void ThreadProxy::scheduledActionBeginContextRecreation() { - DCHECK(isImplThread()); - Proxy::mainThread()->postTask(base::Bind(&ThreadProxy::beginContextRecreation, m_mainThreadWeakPtr)); + DCHECK(IsImplThread()); + Proxy::MainThread()->postTask(base::Bind(&ThreadProxy::beginContextRecreation, m_mainThreadWeakPtr)); } ScheduledActionDrawAndSwapResult ThreadProxy::scheduledActionDrawAndSwapInternal(bool forcedDraw) @@ -816,7 +816,7 @@ ScheduledActionDrawAndSwapResult ThreadProxy::scheduledActionDrawAndSwapInternal ScheduledActionDrawAndSwapResult result; result.didDraw = false; result.didSwap = false; - DCHECK(isImplThread()); + DCHECK(IsImplThread()); DCHECK(m_layerTreeHostImpl.get()); if (!m_layerTreeHostImpl.get()) return result; @@ -880,7 +880,7 @@ ScheduledActionDrawAndSwapResult ThreadProxy::scheduledActionDrawAndSwapInternal // Tell the main thread that the the newly-commited frame was drawn. if (m_nextFrameIsNewlyCommittedFrameOnImplThread) { m_nextFrameIsNewlyCommittedFrameOnImplThread = false; - Proxy::mainThread()->postTask(base::Bind(&ThreadProxy::didCommitAndDrawFrame, m_mainThreadWeakPtr)); + Proxy::MainThread()->postTask(base::Bind(&ThreadProxy::didCommitAndDrawFrame, m_mainThreadWeakPtr)); } if (drawFrame) @@ -891,14 +891,14 @@ ScheduledActionDrawAndSwapResult ThreadProxy::scheduledActionDrawAndSwapInternal return result; } -void ThreadProxy::acquireLayerTextures() +void ThreadProxy::AcquireLayerTextures() { // Called when the main thread needs to modify a layer texture that is used // directly by the compositor. // This method will block until the next compositor draw if there is a // previously committed frame that is still undrawn. This is necessary to // ensure that the main thread does not monopolize access to the textures. - DCHECK(isMainThread()); + DCHECK(IsMainThread()); if (m_texturesAcquired) return; @@ -906,7 +906,7 @@ void ThreadProxy::acquireLayerTextures() TRACE_EVENT0("cc", "ThreadProxy::acquireLayerTextures"); DebugScopedSetMainThreadBlocked mainThreadBlocked(this); CompletionEvent completion; - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::acquireLayerTexturesForMainThreadOnImplThread, m_implThreadWeakPtr, &completion)); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::acquireLayerTexturesForMainThreadOnImplThread, m_implThreadWeakPtr, &completion)); completion.wait(); // Block until it is safe to write to layer textures from the main thread. m_texturesAcquired = true; @@ -914,7 +914,7 @@ void ThreadProxy::acquireLayerTextures() void ThreadProxy::acquireLayerTexturesForMainThreadOnImplThread(CompletionEvent* completion) { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); DCHECK(!m_textureAcquisitionCompletionEventOnImplThread); m_textureAcquisitionCompletionEventOnImplThread = completion; @@ -948,13 +948,13 @@ void ThreadProxy::didAnticipatedDrawTimeChange(base::TimeTicks time) void ThreadProxy::ReadyToFinalizeTextureUpdates() { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); m_schedulerOnImplThread->beginFrameComplete(); } void ThreadProxy::didCommitAndDrawFrame() { - DCHECK(isMainThread()); + DCHECK(IsMainThread()); if (!m_layerTreeHost) return; m_layerTreeHost->didCommitAndDrawFrame(); @@ -962,7 +962,7 @@ void ThreadProxy::didCommitAndDrawFrame() void ThreadProxy::didCompleteSwapBuffers() { - DCHECK(isMainThread()); + DCHECK(IsMainThread()); if (!m_layerTreeHost) return; m_layerTreeHost->didCompleteSwapBuffers(); @@ -971,7 +971,7 @@ void ThreadProxy::didCompleteSwapBuffers() void ThreadProxy::setAnimationEvents(scoped_ptr<AnimationEventsVector> events, base::Time wallClockTime) { TRACE_EVENT0("cc", "ThreadProxy::setAnimationEvents"); - DCHECK(isMainThread()); + DCHECK(IsMainThread()); if (!m_layerTreeHost) return; m_layerTreeHost->setAnimationEvents(events.Pass(), wallClockTime); @@ -980,19 +980,19 @@ void ThreadProxy::setAnimationEvents(scoped_ptr<AnimationEventsVector> events, b void ThreadProxy::beginContextRecreation() { TRACE_EVENT0("cc", "ThreadProxy::beginContextRecreation"); - DCHECK(isMainThread()); + DCHECK(IsMainThread()); m_layerTreeHost->didLoseOutputSurface(); m_outputSurfaceRecreationCallback.Reset(base::Bind(&ThreadProxy::tryToRecreateOutputSurface, base::Unretained(this))); - Proxy::mainThread()->postTask(m_outputSurfaceRecreationCallback.callback()); + Proxy::MainThread()->postTask(m_outputSurfaceRecreationCallback.callback()); } void ThreadProxy::tryToRecreateOutputSurface() { - DCHECK(isMainThread()); + DCHECK(IsMainThread()); DCHECK(m_layerTreeHost); LayerTreeHost::RecreateResult result = m_layerTreeHost->recreateOutputSurface(); if (result == LayerTreeHost::RecreateFailedButTryAgain) - Proxy::mainThread()->postTask(m_outputSurfaceRecreationCallback.callback()); + Proxy::MainThread()->postTask(m_outputSurfaceRecreationCallback.callback()); else if (result == LayerTreeHost::RecreateSucceeded) m_outputSurfaceRecreationCallback.Cancel(); } @@ -1000,14 +1000,14 @@ void ThreadProxy::tryToRecreateOutputSurface() void ThreadProxy::initializeImplOnImplThread(CompletionEvent* completion, InputHandler* handler) { TRACE_EVENT0("cc", "ThreadProxy::initializeImplOnImplThread"); - DCHECK(isImplThread()); + DCHECK(IsImplThread()); m_layerTreeHostImpl = m_layerTreeHost->createLayerTreeHostImpl(this); const base::TimeDelta displayRefreshInterval = base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / 60); scoped_ptr<FrameRateController> frameRateController; if (m_renderVSyncEnabled) - frameRateController.reset(new FrameRateController(DelayBasedTimeSource::create(displayRefreshInterval, Proxy::implThread()))); + frameRateController.reset(new FrameRateController(DelayBasedTimeSource::create(displayRefreshInterval, Proxy::ImplThread()))); else - frameRateController.reset(new FrameRateController(Proxy::implThread())); + frameRateController.reset(new FrameRateController(Proxy::ImplThread())); SchedulerSettings schedulerSettings; schedulerSettings.implSidePainting = m_layerTreeHost->settings().implSidePainting; m_schedulerOnImplThread = Scheduler::create(this, frameRateController.Pass(), @@ -1025,14 +1025,14 @@ void ThreadProxy::initializeImplOnImplThread(CompletionEvent* completion, InputH void ThreadProxy::initializeOutputSurfaceOnImplThread(scoped_ptr<OutputSurface> outputSurface) { TRACE_EVENT0("cc", "ThreadProxy::initializeContextOnImplThread"); - DCHECK(isImplThread()); + DCHECK(IsImplThread()); m_outputSurfaceBeforeInitializationOnImplThread = outputSurface.Pass(); } void ThreadProxy::initializeRendererOnImplThread(CompletionEvent* completion, bool* initializeSucceeded, RendererCapabilities* capabilities) { TRACE_EVENT0("cc", "ThreadProxy::initializeRendererOnImplThread"); - DCHECK(isImplThread()); + DCHECK(IsImplThread()); DCHECK(m_outputSurfaceBeforeInitializationOnImplThread.get()); *initializeSucceeded = m_layerTreeHostImpl->initializeRenderer(m_outputSurfaceBeforeInitializationOnImplThread.Pass()); if (*initializeSucceeded) { @@ -1052,7 +1052,7 @@ void ThreadProxy::initializeRendererOnImplThread(CompletionEvent* completion, bo void ThreadProxy::layerTreeHostClosedOnImplThread(CompletionEvent* completion) { TRACE_EVENT0("cc", "ThreadProxy::layerTreeHostClosedOnImplThread"); - DCHECK(isImplThread()); + DCHECK(IsImplThread()); m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->resourceProvider()); m_inputHandlerOnImplThread.reset(); m_layerTreeHostImpl.reset(); @@ -1063,11 +1063,11 @@ void ThreadProxy::layerTreeHostClosedOnImplThread(CompletionEvent* completion) void ThreadProxy::setFullRootLayerDamageOnImplThread() { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); m_layerTreeHostImpl->SetFullRootLayerDamage(); } -size_t ThreadProxy::maxPartialTextureUpdates() const +size_t ThreadProxy::MaxPartialTextureUpdates() const { return ResourceUpdateController::MaxPartialTextureUpdates(); } @@ -1075,7 +1075,7 @@ size_t ThreadProxy::maxPartialTextureUpdates() const void ThreadProxy::recreateOutputSurfaceOnImplThread(CompletionEvent* completion, scoped_ptr<OutputSurface> outputSurface, scoped_refptr<cc::ContextProvider> offscreenContextProvider, bool* recreateSucceeded, RendererCapabilities* capabilities) { TRACE_EVENT0("cc", "ThreadProxy::recreateOutputSurfaceOnImplThread"); - DCHECK(isImplThread()); + DCHECK(IsImplThread()); m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->resourceProvider()); *recreateSucceeded = m_layerTreeHostImpl->initializeRenderer(outputSurface.Pass()); if (*recreateSucceeded) { @@ -1090,7 +1090,7 @@ void ThreadProxy::recreateOutputSurfaceOnImplThread(CompletionEvent* completion, void ThreadProxy::renderingStatsOnImplThread(CompletionEvent* completion, RenderingStats* stats) { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); m_layerTreeHostImpl->renderingStats(stats); completion->signal(); } @@ -1104,7 +1104,7 @@ ThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState() { } -scoped_ptr<base::Value> ThreadProxy::asValue() const +scoped_ptr<base::Value> ThreadProxy::AsValue() const { scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); @@ -1112,7 +1112,7 @@ scoped_ptr<base::Value> ThreadProxy::asValue() const { DebugScopedSetMainThreadBlocked mainThreadBlocked( const_cast<ThreadProxy*>(this)); - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::asValueOnImplThread, + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::asValueOnImplThread, m_implThreadWeakPtr, &completion, state.get())); @@ -1127,13 +1127,13 @@ void ThreadProxy::asValueOnImplThread(CompletionEvent* completion, base::Diction completion->signal(); } -bool ThreadProxy::commitPendingForTesting() +bool ThreadProxy::CommitPendingForTesting() { - DCHECK(isMainThread()); + DCHECK(IsMainThread()); CommitPendingRequest commitPendingRequest; { DebugScopedSetMainThreadBlocked mainThreadBlocked(this); - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::commitPendingOnImplThreadForTesting, m_implThreadWeakPtr, &commitPendingRequest)); + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::commitPendingOnImplThreadForTesting, m_implThreadWeakPtr, &commitPendingRequest)); commitPendingRequest.completion.wait(); } return commitPendingRequest.commitPending; @@ -1141,7 +1141,7 @@ bool ThreadProxy::commitPendingForTesting() void ThreadProxy::commitPendingOnImplThreadForTesting(CommitPendingRequest* request) { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); if (m_layerTreeHostImpl->outputSurface()) request->commitPending = m_schedulerOnImplThread->commitPending(); else @@ -1149,14 +1149,14 @@ void ThreadProxy::commitPendingOnImplThreadForTesting(CommitPendingRequest* requ request->completion.signal(); } -skia::RefPtr<SkPicture> ThreadProxy::capturePicture() +skia::RefPtr<SkPicture> ThreadProxy::CapturePicture() { - DCHECK(isMainThread()); + DCHECK(IsMainThread()); CompletionEvent completion; skia::RefPtr<SkPicture> picture; { DebugScopedSetMainThreadBlocked mainThreadBlocked(this); - Proxy::implThread()->postTask(base::Bind(&ThreadProxy::capturePictureOnImplThread, + Proxy::ImplThread()->postTask(base::Bind(&ThreadProxy::capturePictureOnImplThread, m_implThreadWeakPtr, &completion, &picture)); @@ -1167,7 +1167,7 @@ skia::RefPtr<SkPicture> ThreadProxy::capturePicture() void ThreadProxy::capturePictureOnImplThread(CompletionEvent* completion, skia::RefPtr<SkPicture>* picture) { - DCHECK(isImplThread()); + DCHECK(IsImplThread()); *picture = m_layerTreeHostImpl->capturePicture(); completion->signal(); } @@ -1219,7 +1219,7 @@ void ThreadProxy::renewTreePriority() if (m_renewTreePriorityOnImplThreadPending) return; - Proxy::implThread()->postDelayedTask( + Proxy::ImplThread()->postDelayedTask( base::Bind(&ThreadProxy::renewTreePriorityOnImplThread, m_weakFactoryOnImplThread.GetWeakPtr()), delay.InMilliseconds()); diff --git a/cc/thread_proxy.h b/cc/thread_proxy.h index f12c7fa..0811d94 100644 --- a/cc/thread_proxy.h +++ b/cc/thread_proxy.h @@ -32,31 +32,31 @@ public: virtual ~ThreadProxy(); // Proxy implementation - virtual bool compositeAndReadback(void *pixels, const gfx::Rect&) OVERRIDE; - virtual void startPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnchor, float scale, base::TimeDelta duration) OVERRIDE; - virtual void finishAllRendering() OVERRIDE; - virtual bool isStarted() const OVERRIDE; - virtual bool initializeOutputSurface() OVERRIDE; - virtual void setSurfaceReady() OVERRIDE; - virtual void setVisible(bool) OVERRIDE; - virtual bool initializeRenderer() OVERRIDE; - virtual bool recreateOutputSurface() OVERRIDE; - virtual void renderingStats(RenderingStats*) OVERRIDE; - virtual const RendererCapabilities& rendererCapabilities() const OVERRIDE; - virtual void setNeedsAnimate() OVERRIDE; - virtual void setNeedsCommit() OVERRIDE; - virtual void setNeedsRedraw() OVERRIDE; - virtual void setDeferCommits(bool) OVERRIDE; - virtual bool commitRequested() const OVERRIDE; - virtual void mainThreadHasStoppedFlinging() OVERRIDE; - virtual void start() OVERRIDE; - virtual void stop() OVERRIDE; - virtual size_t maxPartialTextureUpdates() const OVERRIDE; - virtual void acquireLayerTextures() OVERRIDE; - virtual void forceSerializeOnSwapBuffers() OVERRIDE; - virtual skia::RefPtr<SkPicture> capturePicture() OVERRIDE; - virtual scoped_ptr<base::Value> asValue() const OVERRIDE; - virtual bool commitPendingForTesting() OVERRIDE; + virtual bool CompositeAndReadback(void* pixels, gfx::Rect rect) OVERRIDE; + virtual void StartPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnchor, float scale, base::TimeDelta duration) OVERRIDE; + virtual void FinishAllRendering() OVERRIDE; + virtual bool IsStarted() const OVERRIDE; + virtual bool InitializeOutputSurface() OVERRIDE; + virtual void SetSurfaceReady() OVERRIDE; + virtual void SetVisible(bool) OVERRIDE; + virtual bool InitializeRenderer() OVERRIDE; + virtual bool RecreateOutputSurface() OVERRIDE; + virtual void GetRenderingStats(RenderingStats* stats) OVERRIDE; + virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE; + virtual void SetNeedsAnimate() OVERRIDE; + virtual void SetNeedsCommit() OVERRIDE; + virtual void SetNeedsRedraw() OVERRIDE; + virtual void SetDeferCommits(bool) OVERRIDE; + virtual bool CommitRequested() const OVERRIDE; + virtual void MainThreadHasStoppedFlinging() OVERRIDE; + virtual void Start() OVERRIDE; + virtual void Stop() OVERRIDE; + virtual size_t MaxPartialTextureUpdates() const OVERRIDE; + virtual void AcquireLayerTextures() OVERRIDE; + virtual void ForceSerializeOnSwapBuffers() OVERRIDE; + virtual skia::RefPtr<SkPicture> CapturePicture() OVERRIDE; + virtual scoped_ptr<base::Value> AsValue() const OVERRIDE; + virtual bool CommitPendingForTesting() OVERRIDE; // LayerTreeHostImplClient implementation virtual void didLoseOutputSurfaceOnImplThread() OVERRIDE; @@ -178,7 +178,7 @@ private: scoped_ptr<Scheduler> m_schedulerOnImplThread; // Holds on to the context we might use for compositing in between initializeContext() - // and initializeRenderer() calls. + // and InitializeRenderer() calls. scoped_ptr<OutputSurface> m_outputSurfaceBeforeInitializationOnImplThread; // Set when the main thread is waiting on a scheduledActionBeginFrame to be issued. diff --git a/cc/tiled_layer_unittest.cc b/cc/tiled_layer_unittest.cc index e0c3741..1e02385 100644 --- a/cc/tiled_layer_unittest.cc +++ b/cc/tiled_layer_unittest.cc @@ -92,7 +92,7 @@ public: scoped_ptr<ResourceUpdateController> updateController = ResourceUpdateController::Create( NULL, - m_proxy->implThread(), + m_proxy->ImplThread(), m_queue.Pass(), m_resourceProvider.get()); updateController->Finalize(); diff --git a/cc/video_layer_impl.cc b/cc/video_layer_impl.cc index c455d9a..716796e 100644 --- a/cc/video_layer_impl.cc +++ b/cc/video_layer_impl.cc @@ -31,8 +31,8 @@ scoped_ptr<VideoLayerImpl> VideoLayerImpl::create(LayerTreeImpl* treeImpl, int i { scoped_ptr<VideoLayerImpl> layer(new VideoLayerImpl(treeImpl, id)); layer->setProviderClientImpl(VideoFrameProviderClientImpl::Create(provider)); - DCHECK(treeImpl->proxy()->isImplThread()); - DCHECK(treeImpl->proxy()->isMainThreadBlocked()); + DCHECK(treeImpl->proxy()->IsImplThread()); + DCHECK(treeImpl->proxy()->IsMainThreadBlocked()); return layer.Pass(); } @@ -53,8 +53,8 @@ VideoLayerImpl::~VideoLayerImpl() // on the VideoFrameProviderClientImpl, but we stop when the first // LayerImpl (the one on the pending tree) is destroyed since we know // the main thread is blocked for this commit. - DCHECK(layerTreeImpl()->proxy()->isImplThread()); - DCHECK(layerTreeImpl()->proxy()->isMainThreadBlocked()); + DCHECK(layerTreeImpl()->proxy()->IsImplThread()); + DCHECK(layerTreeImpl()->proxy()->IsMainThreadBlocked()); m_providerClientImpl->Stop(); } freePlaneData(layerTreeImpl()->resource_provider()); |