| Index: cc/layer_tree_host.cc
|
| diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc
|
| index 587a4144c30b365f92388304ea0f565005b50393..524e94300b21262cc4458c51624a7fc632e948e7 100644
|
| --- a/cc/layer_tree_host.cc
|
| +++ b/cc/layer_tree_host.cc
|
| @@ -9,7 +9,6 @@
|
| #include "base/message_loop.h"
|
| #include "base/string_number_conversions.h"
|
| #include "cc/font_atlas.h"
|
| -#include "cc/graphics_context.h"
|
| #include "cc/heads_up_display_layer.h"
|
| #include "cc/heads_up_display_layer_impl.h"
|
| #include "cc/layer.h"
|
| @@ -147,8 +146,6 @@ LayerTreeSettings::~LayerTreeSettings()
|
|
|
| RendererCapabilities::RendererCapabilities()
|
| : bestTextureFormat(0)
|
| - , contextHasCachedFrontBuffer(false)
|
| - , usingPartialSwap(false)
|
| , usingAcceleratedPainting(false)
|
| , usingSetVisibility(false)
|
| , usingSwapCompleteCallback(false)
|
| @@ -184,7 +181,7 @@ LayerTreeHost::LayerTreeHost(LayerTreeHostClient* client, const LayerTreeSetting
|
| , m_commitNumber(0)
|
| , m_renderingStats()
|
| , m_rendererInitialized(false)
|
| - , m_contextLost(false)
|
| + , m_outputSurfaceLost(false)
|
| , m_numTimesRecreateShouldFail(0)
|
| , m_numFailedRecreateAttempts(0)
|
| , m_settings(settings)
|
| @@ -212,7 +209,7 @@ bool LayerTreeHost::initialize(scoped_ptr<Thread> implThread)
|
| m_proxy = SingleThreadProxy::create(this);
|
| m_proxy->start();
|
|
|
| - return m_proxy->initializeContext();
|
| + return m_proxy->initializeOutputSurface();
|
| }
|
|
|
| LayerTreeHost::~LayerTreeHost()
|
| @@ -238,7 +235,7 @@ void LayerTreeHost::initializeRenderer()
|
| {
|
| TRACE_EVENT0("cc", "LayerTreeHost::initializeRenderer");
|
| if (!m_proxy->initializeRenderer()) {
|
| - // Uh oh, better tell the client that we can't do anything with this context.
|
| + // Uh oh, better tell the client that we can't do anything with this output surface.
|
| m_client->didRecreateOutputSurface(false);
|
| return;
|
| }
|
| @@ -260,28 +257,28 @@ void LayerTreeHost::initializeRenderer()
|
| min(m_settings.maxUntiledLayerSize.height(), m_proxy->rendererCapabilities().maxTextureSize));
|
| }
|
|
|
| -LayerTreeHost::RecreateResult LayerTreeHost::recreateContext()
|
| +LayerTreeHost::RecreateResult LayerTreeHost::recreateOutputSurface()
|
| {
|
| - TRACE_EVENT0("cc", "LayerTreeHost::recreateContext");
|
| - DCHECK(m_contextLost);
|
| + TRACE_EVENT0("cc", "LayerTreeHost::recreateOutputSurface");
|
| + DCHECK(m_outputSurfaceLost);
|
|
|
| bool recreated = false;
|
| if (!m_numTimesRecreateShouldFail)
|
| - recreated = m_proxy->recreateContext();
|
| + recreated = m_proxy->recreateOutputSurface();
|
| else
|
| m_numTimesRecreateShouldFail--;
|
|
|
| if (recreated) {
|
| m_client->didRecreateOutputSurface(true);
|
| - m_contextLost = false;
|
| + m_outputSurfaceLost = false;
|
| return RecreateSucceeded;
|
| }
|
|
|
| // Tolerate a certain number of recreation failures to work around races
|
| - // in the context-lost machinery.
|
| + // in the output-surface-lost machinery.
|
| m_numFailedRecreateAttempts++;
|
| if (m_numFailedRecreateAttempts < 5) {
|
| - // FIXME: The single thread does not self-schedule context
|
| + // 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())
|
| @@ -289,8 +286,8 @@ LayerTreeHost::RecreateResult LayerTreeHost::recreateContext()
|
| return RecreateFailedButTryAgain;
|
| }
|
|
|
| - // We have tried too many times to recreate the context. Tell the host to fall
|
| - // back to software rendering.
|
| + // We have tried too many times to recreate the output surface. Tell the
|
| + // host to fall back to software rendering.
|
| m_client->didRecreateOutputSurface(false);
|
| return RecreateFailedAndGaveUp;
|
| }
|
| @@ -416,7 +413,7 @@ void LayerTreeHost::commitComplete()
|
| m_client->didCommit();
|
| }
|
|
|
| -scoped_ptr<GraphicsContext> LayerTreeHost::createContext()
|
| +scoped_ptr<OutputSurface> LayerTreeHost::createOutputSurface()
|
| {
|
| return m_client->createOutputSurface();
|
| }
|
| @@ -431,11 +428,11 @@ scoped_ptr<LayerTreeHostImpl> LayerTreeHost::createLayerTreeHostImpl(LayerTreeHo
|
| return LayerTreeHostImpl::create(m_settings, client, m_proxy.get());
|
| }
|
|
|
| -void LayerTreeHost::didLoseContext()
|
| +void LayerTreeHost::didLoseOutputSurface()
|
| {
|
| - TRACE_EVENT0("cc", "LayerTreeHost::didLoseContext");
|
| + TRACE_EVENT0("cc", "LayerTreeHost::didLoseOutputSurface");
|
| DCHECK(m_proxy->isMainThread());
|
| - m_contextLost = true;
|
| + m_outputSurfaceLost = true;
|
| m_numFailedRecreateAttempts = 0;
|
| setNeedsCommit();
|
| }
|
| @@ -583,11 +580,11 @@ void LayerTreeHost::startPageScaleAnimation(gfx::Vector2d targetOffset, bool use
|
| m_proxy->startPageScaleAnimation(targetOffset, useAnchor, scale, duration);
|
| }
|
|
|
| -void LayerTreeHost::loseContext(int numTimes)
|
| +void LayerTreeHost::loseOutputSurface(int numTimes)
|
| {
|
| - TRACE_EVENT1("cc", "LayerTreeHost::loseCompositorContext", "numTimes", numTimes);
|
| + TRACE_EVENT1("cc", "LayerTreeHost::loseCompositorOutputSurface", "numTimes", numTimes);
|
| m_numTimesRecreateShouldFail = numTimes - 1;
|
| - m_proxy->loseContext();
|
| + m_proxy->loseOutputSurface();
|
| }
|
|
|
| PrioritizedResourceManager* LayerTreeHost::contentsTextureManager() const
|
| @@ -616,8 +613,8 @@ bool LayerTreeHost::initializeRendererIfNeeded()
|
| if (!m_rendererInitialized)
|
| return false;
|
| }
|
| - if (m_contextLost) {
|
| - if (recreateContext() != RecreateSucceeded)
|
| + if (m_outputSurfaceLost) {
|
| + if (recreateOutputSurface() != RecreateSucceeded)
|
| return false;
|
| }
|
| return true;
|
|
|