blob: d26d666af7af4123af1ad3221ac83164dd814533 [file] [log] [blame]
[email protected]94f206c12012-08-25 00:09:141// Copyright 2011 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]4456eee22012-10-19 18:16:385#include "cc/single_thread_proxy.h"
[email protected]94f206c12012-08-25 00:09:146
[email protected]6331a1172012-10-18 11:35:137#include "base/debug/trace_event.h"
[email protected]aa0a9d32012-10-24 01:58:108#include "cc/draw_quad.h"
[email protected]d50c6862012-10-23 02:08:319#include "cc/layer_tree_host.h"
[email protected]3be2171d2012-12-06 06:13:2010#include "cc/output_surface.h"
[email protected]b4da2032012-10-25 21:22:5511#include "cc/resource_update_controller.h"
[email protected]61de5812012-11-08 07:03:4412#include "cc/thread.h"
[email protected]94f206c12012-08-25 00:09:1413
[email protected]9c88e562012-09-14 22:21:3014namespace cc {
[email protected]94f206c12012-08-25 00:09:1415
[email protected]96baf3e2012-10-22 23:09:5516scoped_ptr<Proxy> SingleThreadProxy::create(LayerTreeHost* layerTreeHost)
[email protected]94f206c12012-08-25 00:09:1417{
[email protected]96baf3e2012-10-22 23:09:5518 return make_scoped_ptr(new SingleThreadProxy(layerTreeHost)).PassAs<Proxy>();
[email protected]94f206c12012-08-25 00:09:1419}
20
[email protected]96baf3e2012-10-22 23:09:5521SingleThreadProxy::SingleThreadProxy(LayerTreeHost* layerTreeHost)
[email protected]61de5812012-11-08 07:03:4422 : Proxy(scoped_ptr<Thread>(NULL))
23 , m_layerTreeHost(layerTreeHost)
[email protected]3be2171d2012-12-06 06:13:2024 , m_outputSurfaceLost(false)
[email protected]94f206c12012-08-25 00:09:1425 , m_rendererInitialized(false)
26 , m_nextFrameIsNewlyCommittedFrame(false)
[email protected]8b9af6b2012-09-27 00:36:3627 , m_totalCommitCount(0)
[email protected]94f206c12012-08-25 00:09:1428{
[email protected]96baf3e2012-10-22 23:09:5529 TRACE_EVENT0("cc", "SingleThreadProxy::SingleThreadProxy");
30 DCHECK(Proxy::isMainThread());
[email protected]94f206c12012-08-25 00:09:1431}
32
[email protected]96baf3e2012-10-22 23:09:5533void SingleThreadProxy::start()
[email protected]94f206c12012-08-25 00:09:1434{
[email protected]61de5812012-11-08 07:03:4435 DebugScopedSetImplThread impl(this);
[email protected]94f206c12012-08-25 00:09:1436 m_layerTreeHostImpl = m_layerTreeHost->createLayerTreeHostImpl(this);
37}
38
[email protected]96baf3e2012-10-22 23:09:5539SingleThreadProxy::~SingleThreadProxy()
[email protected]94f206c12012-08-25 00:09:1440{
[email protected]96baf3e2012-10-22 23:09:5541 TRACE_EVENT0("cc", "SingleThreadProxy::~SingleThreadProxy");
42 DCHECK(Proxy::isMainThread());
[email protected]1d993172012-10-18 18:15:0443 DCHECK(!m_layerTreeHostImpl.get() && !m_layerTreeHost); // make sure stop() got called.
[email protected]94f206c12012-08-25 00:09:1444}
45
[email protected]aad0a0072012-11-01 18:15:5846bool SingleThreadProxy::compositeAndReadback(void *pixels, const gfx::Rect& rect)
[email protected]94f206c12012-08-25 00:09:1447{
[email protected]96baf3e2012-10-22 23:09:5548 TRACE_EVENT0("cc", "SingleThreadProxy::compositeAndReadback");
49 DCHECK(Proxy::isMainThread());
[email protected]94f206c12012-08-25 00:09:1450
51 if (!commitAndComposite())
52 return false;
53
54 m_layerTreeHostImpl->readback(pixels, rect);
55
56 if (m_layerTreeHostImpl->isContextLost())
57 return false;
58
59 m_layerTreeHostImpl->swapBuffers();
60 didSwapFrame();
61
62 return true;
63}
64
[email protected]c9c1ebe2012-11-05 20:46:1365void SingleThreadProxy::startPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnchor, float scale, base::TimeDelta duration)
[email protected]94f206c12012-08-25 00:09:1466{
[email protected]c9c1ebe2012-11-05 20:46:1367 m_layerTreeHostImpl->startPageScaleAnimation(targetOffset, useAnchor, scale, base::TimeTicks::Now(), duration);
[email protected]94f206c12012-08-25 00:09:1468}
69
[email protected]96baf3e2012-10-22 23:09:5570void SingleThreadProxy::finishAllRendering()
[email protected]94f206c12012-08-25 00:09:1471{
[email protected]96baf3e2012-10-22 23:09:5572 DCHECK(Proxy::isMainThread());
[email protected]94f206c12012-08-25 00:09:1473 {
[email protected]61de5812012-11-08 07:03:4474 DebugScopedSetImplThread impl(this);
[email protected]94f206c12012-08-25 00:09:1475 m_layerTreeHostImpl->finishAllRendering();
76 }
77}
78
[email protected]96baf3e2012-10-22 23:09:5579bool SingleThreadProxy::isStarted() const
[email protected]94f206c12012-08-25 00:09:1480{
[email protected]96baf3e2012-10-22 23:09:5581 DCHECK(Proxy::isMainThread());
[email protected]519281762012-10-06 20:06:3982 return m_layerTreeHostImpl.get();
[email protected]94f206c12012-08-25 00:09:1483}
84
[email protected]3be2171d2012-12-06 06:13:2085bool SingleThreadProxy::initializeOutputSurface()
[email protected]94f206c12012-08-25 00:09:1486{
[email protected]96baf3e2012-10-22 23:09:5587 DCHECK(Proxy::isMainThread());
[email protected]3be2171d2012-12-06 06:13:2088 scoped_ptr<OutputSurface> outputSurface = m_layerTreeHost->createOutputSurface();
89 if (!outputSurface.get())
[email protected]94f206c12012-08-25 00:09:1490 return false;
[email protected]3be2171d2012-12-06 06:13:2091 m_outputSurfaceBeforeInitialization = outputSurface.Pass();
[email protected]94f206c12012-08-25 00:09:1492 return true;
93}
94
[email protected]96baf3e2012-10-22 23:09:5595void SingleThreadProxy::setSurfaceReady()
[email protected]94f206c12012-08-25 00:09:1496{
97 // Scheduling is controlled by the embedder in the single thread case, so nothing to do.
98}
99
[email protected]96baf3e2012-10-22 23:09:55100void SingleThreadProxy::setVisible(bool visible)
[email protected]94f206c12012-08-25 00:09:14101{
[email protected]61de5812012-11-08 07:03:44102 DebugScopedSetImplThread impl(this);
[email protected]94f206c12012-08-25 00:09:14103 m_layerTreeHostImpl->setVisible(visible);
104}
105
[email protected]96baf3e2012-10-22 23:09:55106bool SingleThreadProxy::initializeRenderer()
[email protected]94f206c12012-08-25 00:09:14107{
[email protected]96baf3e2012-10-22 23:09:55108 DCHECK(Proxy::isMainThread());
[email protected]3be2171d2012-12-06 06:13:20109 DCHECK(m_outputSurfaceBeforeInitialization.get());
[email protected]94f206c12012-08-25 00:09:14110 {
[email protected]61de5812012-11-08 07:03:44111 DebugScopedSetImplThread impl(this);
[email protected]3be2171d2012-12-06 06:13:20112 bool ok = m_layerTreeHostImpl->initializeRenderer(m_outputSurfaceBeforeInitialization.Pass());
[email protected]94f206c12012-08-25 00:09:14113 if (ok) {
114 m_rendererInitialized = true;
115 m_RendererCapabilitiesForMainThread = m_layerTreeHostImpl->rendererCapabilities();
116 }
117
118 return ok;
119 }
120}
121
[email protected]3be2171d2012-12-06 06:13:20122bool SingleThreadProxy::recreateOutputSurface()
[email protected]94f206c12012-08-25 00:09:14123{
[email protected]96baf3e2012-10-22 23:09:55124 TRACE_EVENT0("cc", "SingleThreadProxy::recreateContext");
125 DCHECK(Proxy::isMainThread());
[email protected]3be2171d2012-12-06 06:13:20126 DCHECK(m_outputSurfaceLost);
[email protected]94f206c12012-08-25 00:09:14127
[email protected]3be2171d2012-12-06 06:13:20128 scoped_ptr<OutputSurface> outputSurface = m_layerTreeHost->createOutputSurface();
129 if (!outputSurface.get())
[email protected]94f206c12012-08-25 00:09:14130 return false;
131
132 bool initialized;
133 {
[email protected]61de5812012-11-08 07:03:44134 DebugScopedSetMainThreadBlocked mainThreadBlocked(this);
135 DebugScopedSetImplThread impl(this);
[email protected]94f206c12012-08-25 00:09:14136 if (!m_layerTreeHostImpl->contentsTexturesPurged())
137 m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->resourceProvider());
[email protected]3be2171d2012-12-06 06:13:20138 initialized = m_layerTreeHostImpl->initializeRenderer(outputSurface.Pass());
[email protected]94f206c12012-08-25 00:09:14139 if (initialized) {
140 m_RendererCapabilitiesForMainThread = m_layerTreeHostImpl->rendererCapabilities();
141 }
142 }
143
144 if (initialized)
[email protected]3be2171d2012-12-06 06:13:20145 m_outputSurfaceLost = false;
[email protected]94f206c12012-08-25 00:09:14146
147 return initialized;
148}
149
[email protected]96baf3e2012-10-22 23:09:55150void SingleThreadProxy::renderingStats(RenderingStats* stats)
[email protected]94f206c12012-08-25 00:09:14151{
[email protected]8b9af6b2012-09-27 00:36:36152 stats->totalCommitTimeInSeconds = m_totalCommitTime.InSecondsF();
153 stats->totalCommitCount = m_totalCommitCount;
[email protected]94f206c12012-08-25 00:09:14154 m_layerTreeHostImpl->renderingStats(stats);
155}
156
[email protected]96baf3e2012-10-22 23:09:55157const RendererCapabilities& SingleThreadProxy::rendererCapabilities() const
[email protected]94f206c12012-08-25 00:09:14158{
[email protected]1d993172012-10-18 18:15:04159 DCHECK(m_rendererInitialized);
[email protected]94f206c12012-08-25 00:09:14160 // Note: this gets called during the commit by the "impl" thread
161 return m_RendererCapabilitiesForMainThread;
162}
163
[email protected]3be2171d2012-12-06 06:13:20164void SingleThreadProxy::loseOutputSurface()
[email protected]94f206c12012-08-25 00:09:14165{
[email protected]96baf3e2012-10-22 23:09:55166 DCHECK(Proxy::isMainThread());
[email protected]3be2171d2012-12-06 06:13:20167 m_layerTreeHost->didLoseOutputSurface();
168 m_outputSurfaceLost = true;
[email protected]94f206c12012-08-25 00:09:14169}
170
[email protected]96baf3e2012-10-22 23:09:55171void SingleThreadProxy::setNeedsAnimate()
[email protected]94f206c12012-08-25 00:09:14172{
[email protected]96baf3e2012-10-22 23:09:55173 // Thread-only feature
[email protected]1d993172012-10-18 18:15:04174 NOTREACHED();
[email protected]94f206c12012-08-25 00:09:14175}
176
[email protected]b4da2032012-10-25 21:22:55177void SingleThreadProxy::doCommit(scoped_ptr<ResourceUpdateQueue> queue)
[email protected]94f206c12012-08-25 00:09:14178{
[email protected]96baf3e2012-10-22 23:09:55179 DCHECK(Proxy::isMainThread());
[email protected]94f206c12012-08-25 00:09:14180 // Commit immediately
181 {
[email protected]61de5812012-11-08 07:03:44182 DebugScopedSetMainThreadBlocked mainThreadBlocked(this);
183 DebugScopedSetImplThread impl(this);
[email protected]94f206c12012-08-25 00:09:14184
[email protected]8b9af6b2012-09-27 00:36:36185 base::TimeTicks startTime = base::TimeTicks::HighResNow();
[email protected]94f206c12012-08-25 00:09:14186 m_layerTreeHostImpl->beginCommit();
187
[email protected]2c7d23f2012-10-15 20:43:25188 m_layerTreeHost->contentsTextureManager()->pushTexturePrioritiesToBackings();
[email protected]94f206c12012-08-25 00:09:14189 m_layerTreeHost->beginCommitOnImplThread(m_layerTreeHostImpl.get());
190
[email protected]b4da2032012-10-25 21:22:55191 scoped_ptr<ResourceUpdateController> updateController =
192 ResourceUpdateController::create(
[email protected]f961b792012-09-20 07:27:33193 NULL,
[email protected]96baf3e2012-10-22 23:09:55194 Proxy::mainThread(),
[email protected]b1b800c2012-10-16 05:03:59195 queue.Pass(),
[email protected]61de5812012-11-08 07:03:44196 m_layerTreeHostImpl->resourceProvider(),
197 hasImplThread());
[email protected]f961b792012-09-20 07:27:33198 updateController->finalize();
[email protected]94f206c12012-08-25 00:09:14199
200 m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get());
201
202 m_layerTreeHostImpl->commitComplete();
203
[email protected]1d993172012-10-18 18:15:04204#ifndef NDEBUG
[email protected]94f206c12012-08-25 00:09:14205 // In the single-threaded case, the scroll deltas should never be
206 // touched on the impl layer tree.
[email protected]96baf3e2012-10-22 23:09:55207 scoped_ptr<ScrollAndScaleSet> scrollInfo = m_layerTreeHostImpl->processScrollDeltas();
[email protected]1d993172012-10-18 18:15:04208 DCHECK(!scrollInfo->scrolls.size());
[email protected]94f206c12012-08-25 00:09:14209#endif
[email protected]8b9af6b2012-09-27 00:36:36210
211 base::TimeTicks endTime = base::TimeTicks::HighResNow();
212 m_totalCommitTime += endTime - startTime;
213 m_totalCommitCount++;
[email protected]94f206c12012-08-25 00:09:14214 }
215 m_layerTreeHost->commitComplete();
216 m_nextFrameIsNewlyCommittedFrame = true;
217}
218
[email protected]96baf3e2012-10-22 23:09:55219void SingleThreadProxy::setNeedsCommit()
[email protected]94f206c12012-08-25 00:09:14220{
[email protected]96baf3e2012-10-22 23:09:55221 DCHECK(Proxy::isMainThread());
[email protected]94f206c12012-08-25 00:09:14222 m_layerTreeHost->scheduleComposite();
223}
224
[email protected]96baf3e2012-10-22 23:09:55225void SingleThreadProxy::setNeedsRedraw()
[email protected]94f206c12012-08-25 00:09:14226{
227 // FIXME: Once we move render_widget scheduling into this class, we can
228 // treat redraw requests more efficiently than commitAndRedraw requests.
229 m_layerTreeHostImpl->setFullRootLayerDamage();
230 setNeedsCommit();
231}
232
[email protected]6b16679e2012-10-27 00:44:28233void SingleThreadProxy::setDeferCommits(bool deferCommits)
234{
235 // Thread-only feature.
236 NOTREACHED();
237}
238
[email protected]96baf3e2012-10-22 23:09:55239bool SingleThreadProxy::commitRequested() const
[email protected]94f206c12012-08-25 00:09:14240{
241 return false;
242}
243
[email protected]96baf3e2012-10-22 23:09:55244void SingleThreadProxy::didAddAnimation()
[email protected]94f206c12012-08-25 00:09:14245{
246}
247
[email protected]96baf3e2012-10-22 23:09:55248size_t SingleThreadProxy::maxPartialTextureUpdates() const
[email protected]493067512012-09-19 23:34:10249{
250 return std::numeric_limits<size_t>::max();
251}
252
[email protected]96baf3e2012-10-22 23:09:55253void SingleThreadProxy::stop()
[email protected]94f206c12012-08-25 00:09:14254{
[email protected]96baf3e2012-10-22 23:09:55255 TRACE_EVENT0("cc", "SingleThreadProxy::stop");
256 DCHECK(Proxy::isMainThread());
[email protected]94f206c12012-08-25 00:09:14257 {
[email protected]61de5812012-11-08 07:03:44258 DebugScopedSetMainThreadBlocked mainThreadBlocked(this);
259 DebugScopedSetImplThread impl(this);
[email protected]94f206c12012-08-25 00:09:14260
261 if (!m_layerTreeHostImpl->contentsTexturesPurged())
262 m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->resourceProvider());
[email protected]519281762012-10-06 20:06:39263 m_layerTreeHostImpl.reset();
[email protected]94f206c12012-08-25 00:09:14264 }
265 m_layerTreeHost = 0;
266}
267
[email protected]96baf3e2012-10-22 23:09:55268void SingleThreadProxy::setNeedsRedrawOnImplThread()
[email protected]493067512012-09-19 23:34:10269{
270 m_layerTreeHost->scheduleComposite();
271}
272
[email protected]96baf3e2012-10-22 23:09:55273void SingleThreadProxy::setNeedsCommitOnImplThread()
[email protected]493067512012-09-19 23:34:10274{
275 m_layerTreeHost->scheduleComposite();
276}
277
[email protected]8947cbe2012-11-28 05:27:43278void SingleThreadProxy::setNeedsManageTilesOnImplThread()
279{
280 m_layerTreeHost->scheduleComposite();
281}
282
[email protected]30faac92012-10-29 00:06:29283void SingleThreadProxy::postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector> events, base::Time wallClockTime)
[email protected]94f206c12012-08-25 00:09:14284{
[email protected]96baf3e2012-10-22 23:09:55285 DCHECK(Proxy::isImplThread());
[email protected]61de5812012-11-08 07:03:44286 DebugScopedSetMainThread main(this);
[email protected]ec1d6d52012-10-10 01:28:57287 m_layerTreeHost->setAnimationEvents(events.Pass(), wallClockTime);
[email protected]94f206c12012-08-25 00:09:14288}
289
[email protected]96baf3e2012-10-22 23:09:55290bool SingleThreadProxy::reduceContentsTextureMemoryOnImplThread(size_t limitBytes, int priorityCutoff)
[email protected]e1fc8b32012-09-18 20:29:09291{
[email protected]1d993172012-10-18 18:15:04292 DCHECK(isImplThread());
[email protected]b1969fa2012-10-17 20:16:29293 if (!m_layerTreeHost->contentsTextureManager())
294 return false;
295
[email protected]a0a00842012-10-22 22:50:28296 return m_layerTreeHost->contentsTextureManager()->reduceMemoryOnImplThread(limitBytes, priorityCutoff, m_layerTreeHostImpl->resourceProvider());
[email protected]e1fc8b32012-09-18 20:29:09297}
298
[email protected]3d21e022012-10-25 20:03:08299void SingleThreadProxy::sendManagedMemoryStats()
300{
301 DCHECK(Proxy::isImplThread());
[email protected]1235c9cc2012-10-27 03:33:46302 if (!m_layerTreeHostImpl.get())
303 return;
304 if (!m_layerTreeHostImpl->renderer())
305 return;
306 if (!m_layerTreeHost->contentsTextureManager())
307 return;
308
309 m_layerTreeHostImpl->renderer()->sendManagedMemoryStats(
310 m_layerTreeHost->contentsTextureManager()->memoryVisibleBytes(),
311 m_layerTreeHost->contentsTextureManager()->memoryVisibleAndNearbyBytes(),
312 m_layerTreeHost->contentsTextureManager()->memoryUseBytes());
[email protected]3d21e022012-10-25 20:03:08313}
314
[email protected]94f206c12012-08-25 00:09:14315// Called by the legacy scheduling path (e.g. where render_widget does the scheduling)
[email protected]96baf3e2012-10-22 23:09:55316void SingleThreadProxy::compositeImmediately()
[email protected]94f206c12012-08-25 00:09:14317{
318 if (commitAndComposite()) {
319 m_layerTreeHostImpl->swapBuffers();
320 didSwapFrame();
321 }
322}
323
[email protected]96baf3e2012-10-22 23:09:55324void SingleThreadProxy::forceSerializeOnSwapBuffers()
[email protected]94f206c12012-08-25 00:09:14325{
326 {
[email protected]61de5812012-11-08 07:03:44327 DebugScopedSetImplThread impl(this);
[email protected]94f206c12012-08-25 00:09:14328 if (m_rendererInitialized)
329 m_layerTreeHostImpl->renderer()->doNoOp();
330 }
331}
332
[email protected]96baf3e2012-10-22 23:09:55333void SingleThreadProxy::onSwapBuffersCompleteOnImplThread()
[email protected]493067512012-09-19 23:34:10334{
[email protected]1d993172012-10-18 18:15:04335 NOTREACHED();
[email protected]493067512012-09-19 23:34:10336}
337
[email protected]96baf3e2012-10-22 23:09:55338bool SingleThreadProxy::commitAndComposite()
[email protected]94f206c12012-08-25 00:09:14339{
[email protected]96baf3e2012-10-22 23:09:55340 DCHECK(Proxy::isMainThread());
[email protected]94f206c12012-08-25 00:09:14341
[email protected]94f206c12012-08-25 00:09:14342 if (!m_layerTreeHost->initializeRendererIfNeeded())
343 return false;
344
[email protected]9fa7d382012-11-30 05:21:14345 m_layerTreeHost->contentsTextureManager()->unlinkAndClearEvictedBackings();
[email protected]94f206c12012-08-25 00:09:14346
[email protected]b4da2032012-10-25 21:22:55347 scoped_ptr<ResourceUpdateQueue> queue = make_scoped_ptr(new ResourceUpdateQueue);
[email protected]f961b792012-09-20 07:27:33348 m_layerTreeHost->updateLayers(*(queue.get()), m_layerTreeHostImpl->memoryAllocationLimitBytes());
[email protected]e1fc8b32012-09-18 20:29:09349
350 if (m_layerTreeHostImpl->contentsTexturesPurged())
351 m_layerTreeHostImpl->resetContentsTexturesPurged();
[email protected]94f206c12012-08-25 00:09:14352
353 m_layerTreeHost->willCommit();
[email protected]b1b800c2012-10-16 05:03:59354 doCommit(queue.Pass());
[email protected]94f206c12012-08-25 00:09:14355 bool result = doComposite();
356 m_layerTreeHost->didBeginFrame();
357 return result;
358}
359
[email protected]96baf3e2012-10-22 23:09:55360bool SingleThreadProxy::doComposite()
[email protected]94f206c12012-08-25 00:09:14361{
[email protected]3be2171d2012-12-06 06:13:20362 DCHECK(!m_outputSurfaceLost);
[email protected]94f206c12012-08-25 00:09:14363 {
[email protected]61de5812012-11-08 07:03:44364 DebugScopedSetImplThread impl(this);
[email protected]94f206c12012-08-25 00:09:14365
366 if (!m_layerTreeHostImpl->visible())
367 return false;
368
[email protected]30faac92012-10-29 00:06:29369 m_layerTreeHostImpl->animate(base::TimeTicks::Now(), base::Time::Now());
[email protected]94f206c12012-08-25 00:09:14370
[email protected]8947cbe2012-11-28 05:27:43371 if (m_layerTreeHostImpl->settings().implSidePainting)
372 m_layerTreeHostImpl->manageTiles();
373
[email protected]94f206c12012-08-25 00:09:14374 // We guard prepareToDraw() with canDraw() because it always returns a valid frame, so can only
375 // be used when such a frame is possible. Since drawLayers() depends on the result of
376 // prepareToDraw(), it is guarded on canDraw() as well.
377 if (!m_layerTreeHostImpl->canDraw())
378 return false;
379
[email protected]96baf3e2012-10-22 23:09:55380 LayerTreeHostImpl::FrameData frame;
[email protected]94f206c12012-08-25 00:09:14381 m_layerTreeHostImpl->prepareToDraw(frame);
382 m_layerTreeHostImpl->drawLayers(frame);
383 m_layerTreeHostImpl->didDrawAllLayers(frame);
384 }
385
386 if (m_layerTreeHostImpl->isContextLost()) {
[email protected]3be2171d2012-12-06 06:13:20387 m_outputSurfaceLost = true;
388 m_layerTreeHost->didLoseOutputSurface();
[email protected]94f206c12012-08-25 00:09:14389 return false;
390 }
391
392 return true;
393}
394
[email protected]96baf3e2012-10-22 23:09:55395void SingleThreadProxy::didSwapFrame()
[email protected]94f206c12012-08-25 00:09:14396{
397 if (m_nextFrameIsNewlyCommittedFrame) {
398 m_nextFrameIsNewlyCommittedFrame = false;
399 m_layerTreeHost->didCommitAndDrawFrame();
400 }
401}
402
[email protected]bc5e77c2012-11-05 20:00:49403} // namespace cc