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

Side by Side Diff: cc/LayerChromium.cpp

Issue 11122003: [cc] Rename all cc/ filenames to Chromium style (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/LayerChromium.h ('k') | cc/LayerPainterChromium.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2010 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
5 #include "config.h"
6
7 #if USE(ACCELERATED_COMPOSITING)
8 #include "LayerChromium.h"
9
10 #include "CCActiveAnimation.h"
11 #include "CCAnimationEvents.h"
12 #include "CCLayerAnimationController.h"
13 #include "CCLayerImpl.h"
14 #include "CCLayerTreeHost.h"
15 #include "CCSettings.h"
16 #include <public/WebAnimationDelegate.h>
17 #include <public/WebLayerScrollClient.h>
18 #include <public/WebSize.h>
19
20 using namespace std;
21 using WebKit::WebTransformationMatrix;
22
23 namespace cc {
24
25 static int s_nextLayerId = 1;
26
27 scoped_refptr<LayerChromium> LayerChromium::create()
28 {
29 return make_scoped_refptr(new LayerChromium());
30 }
31
32 LayerChromium::LayerChromium()
33 : m_needsDisplay(false)
34 , m_stackingOrderChanged(false)
35 , m_layerId(s_nextLayerId++)
36 , m_parent(0)
37 , m_layerTreeHost(0)
38 , m_layerAnimationController(CCLayerAnimationController::create(this))
39 , m_scrollable(false)
40 , m_shouldScrollOnMainThread(false)
41 , m_haveWheelEventHandlers(false)
42 , m_nonFastScrollableRegionChanged(false)
43 , m_anchorPoint(0.5, 0.5)
44 , m_backgroundColor(0)
45 , m_debugBorderColor(0)
46 , m_debugBorderWidth(0)
47 , m_opacity(1.0)
48 , m_anchorPointZ(0)
49 , m_isContainerForFixedPositionLayers(false)
50 , m_fixedToContainerLayer(false)
51 , m_isDrawable(false)
52 , m_masksToBounds(false)
53 , m_contentsOpaque(false)
54 , m_doubleSided(true)
55 , m_useLCDText(false)
56 , m_preserves3D(false)
57 , m_useParentBackfaceVisibility(false)
58 , m_drawCheckerboardForMissingTiles(false)
59 , m_forceRenderSurface(false)
60 , m_replicaLayer(0)
61 , m_drawOpacity(0)
62 , m_drawOpacityIsAnimating(false)
63 , m_renderTarget(0)
64 , m_drawTransformIsAnimating(false)
65 , m_screenSpaceTransformIsAnimating(false)
66 , m_contentsScale(1.0)
67 , m_boundsContainPageScale(false)
68 , m_layerAnimationDelegate(0)
69 , m_layerScrollClient(0)
70 {
71 if (m_layerId < 0) {
72 s_nextLayerId = 1;
73 m_layerId = s_nextLayerId++;
74 }
75 }
76
77 LayerChromium::~LayerChromium()
78 {
79 // Our parent should be holding a reference to us so there should be no
80 // way for us to be destroyed while we still have a parent.
81 ASSERT(!parent());
82
83 // Remove the parent reference from all children.
84 removeAllChildren();
85 }
86
87 void LayerChromium::setUseLCDText(bool useLCDText)
88 {
89 m_useLCDText = useLCDText;
90 }
91
92 void LayerChromium::setLayerTreeHost(CCLayerTreeHost* host)
93 {
94 if (m_layerTreeHost == host)
95 return;
96
97 m_layerTreeHost = host;
98
99 for (size_t i = 0; i < m_children.size(); ++i)
100 m_children[i]->setLayerTreeHost(host);
101
102 if (m_maskLayer)
103 m_maskLayer->setLayerTreeHost(host);
104 if (m_replicaLayer)
105 m_replicaLayer->setLayerTreeHost(host);
106
107 // If this layer already has active animations, the host needs to be notifie d.
108 if (host && m_layerAnimationController->hasActiveAnimation())
109 host->didAddAnimation();
110 }
111
112 void LayerChromium::setNeedsCommit()
113 {
114 if (m_layerTreeHost)
115 m_layerTreeHost->setNeedsCommit();
116 }
117
118 IntRect LayerChromium::layerRectToContentRect(const WebKit::WebRect& layerRect)
119 {
120 float widthScale = static_cast<float>(contentBounds().width()) / bounds().wi dth();
121 float heightScale = static_cast<float>(contentBounds().height()) / bounds(). height();
122 FloatRect contentRect(layerRect.x, layerRect.y, layerRect.width, layerRect.h eight);
123 contentRect.scale(widthScale, heightScale);
124 return enclosingIntRect(contentRect);
125 }
126
127 void LayerChromium::setParent(LayerChromium* layer)
128 {
129 ASSERT(!layer || !layer->hasAncestor(this));
130 m_parent = layer;
131 setLayerTreeHost(m_parent ? m_parent->layerTreeHost() : 0);
132 }
133
134 bool LayerChromium::hasAncestor(LayerChromium* ancestor) const
135 {
136 for (LayerChromium* layer = parent(); layer; layer = layer->parent()) {
137 if (layer == ancestor)
138 return true;
139 }
140 return false;
141 }
142
143 void LayerChromium::addChild(scoped_refptr<LayerChromium> child)
144 {
145 insertChild(child, numChildren());
146 }
147
148 void LayerChromium::insertChild(scoped_refptr<LayerChromium> child, size_t index )
149 {
150 index = min(index, m_children.size());
151 child->removeFromParent();
152 child->setParent(this);
153 child->m_stackingOrderChanged = true;
154
155 LayerList::iterator iter = m_children.begin();
156 m_children.insert(iter + index, child);
157 setNeedsCommit();
158 }
159
160 void LayerChromium::removeFromParent()
161 {
162 if (m_parent)
163 m_parent->removeChild(this);
164 }
165
166 void LayerChromium::removeChild(LayerChromium* child)
167 {
168 for (LayerList::iterator iter = m_children.begin(); iter != m_children.end() ; ++iter)
169 {
170 if (*iter != child)
171 continue;
172
173 child->setParent(0);
174 m_children.erase(iter);
175 setNeedsCommit();
176 return;
177 }
178 }
179
180 void LayerChromium::replaceChild(LayerChromium* reference, scoped_refptr<LayerCh romium> newLayer)
181 {
182 ASSERT_ARG(reference, reference);
183 ASSERT_ARG(reference, reference->parent() == this);
184
185 if (reference == newLayer)
186 return;
187
188 int referenceIndex = indexOfChild(reference);
189 if (referenceIndex == -1) {
190 ASSERT_NOT_REACHED();
191 return;
192 }
193
194 reference->removeFromParent();
195
196 if (newLayer) {
197 newLayer->removeFromParent();
198 insertChild(newLayer, referenceIndex);
199 }
200 }
201
202 int LayerChromium::indexOfChild(const LayerChromium* reference)
203 {
204 for (size_t i = 0; i < m_children.size(); i++) {
205 if (m_children[i] == reference)
206 return i;
207 }
208 return -1;
209 }
210
211 void LayerChromium::setBounds(const IntSize& size)
212 {
213 if (bounds() == size)
214 return;
215
216 bool firstResize = bounds().isEmpty() && !size.isEmpty();
217
218 m_bounds = size;
219
220 if (firstResize)
221 setNeedsDisplay();
222 else
223 setNeedsCommit();
224 }
225
226 LayerChromium* LayerChromium::rootLayer()
227 {
228 LayerChromium* layer = this;
229 while (layer->parent())
230 layer = layer->parent();
231 return layer;
232 }
233
234 void LayerChromium::removeAllChildren()
235 {
236 while (m_children.size()) {
237 LayerChromium* layer = m_children[0].get();
238 ASSERT(layer->parent());
239 layer->removeFromParent();
240 }
241 }
242
243 void LayerChromium::setChildren(const LayerList& children)
244 {
245 if (children == m_children)
246 return;
247
248 removeAllChildren();
249 size_t listSize = children.size();
250 for (size_t i = 0; i < listSize; i++)
251 addChild(children[i]);
252 }
253
254 void LayerChromium::setAnchorPoint(const FloatPoint& anchorPoint)
255 {
256 if (m_anchorPoint == anchorPoint)
257 return;
258 m_anchorPoint = anchorPoint;
259 setNeedsCommit();
260 }
261
262 void LayerChromium::setAnchorPointZ(float anchorPointZ)
263 {
264 if (m_anchorPointZ == anchorPointZ)
265 return;
266 m_anchorPointZ = anchorPointZ;
267 setNeedsCommit();
268 }
269
270 void LayerChromium::setBackgroundColor(SkColor backgroundColor)
271 {
272 if (m_backgroundColor == backgroundColor)
273 return;
274 m_backgroundColor = backgroundColor;
275 setNeedsCommit();
276 }
277
278 IntSize LayerChromium::contentBounds() const
279 {
280 return bounds();
281 }
282
283 void LayerChromium::setMasksToBounds(bool masksToBounds)
284 {
285 if (m_masksToBounds == masksToBounds)
286 return;
287 m_masksToBounds = masksToBounds;
288 setNeedsCommit();
289 }
290
291 void LayerChromium::setMaskLayer(LayerChromium* maskLayer)
292 {
293 if (m_maskLayer == maskLayer)
294 return;
295 if (m_maskLayer)
296 m_maskLayer->setLayerTreeHost(0);
297 m_maskLayer = maskLayer;
298 if (m_maskLayer) {
299 m_maskLayer->setLayerTreeHost(m_layerTreeHost);
300 m_maskLayer->setIsMask(true);
301 }
302 setNeedsCommit();
303 }
304
305 void LayerChromium::setReplicaLayer(LayerChromium* layer)
306 {
307 if (m_replicaLayer == layer)
308 return;
309 if (m_replicaLayer)
310 m_replicaLayer->setLayerTreeHost(0);
311 m_replicaLayer = layer;
312 if (m_replicaLayer)
313 m_replicaLayer->setLayerTreeHost(m_layerTreeHost);
314 setNeedsCommit();
315 }
316
317 void LayerChromium::setFilters(const WebKit::WebFilterOperations& filters)
318 {
319 if (m_filters == filters)
320 return;
321 m_filters = filters;
322 setNeedsCommit();
323 if (!filters.isEmpty())
324 CCLayerTreeHost::setNeedsFilterContext(true);
325 }
326
327 void LayerChromium::setBackgroundFilters(const WebKit::WebFilterOperations& back groundFilters)
328 {
329 if (m_backgroundFilters == backgroundFilters)
330 return;
331 m_backgroundFilters = backgroundFilters;
332 setNeedsCommit();
333 if (!backgroundFilters.isEmpty())
334 CCLayerTreeHost::setNeedsFilterContext(true);
335 }
336
337 bool LayerChromium::needsDisplay() const
338 {
339 return m_needsDisplay;
340 }
341
342 void LayerChromium::setOpacity(float opacity)
343 {
344 if (m_opacity == opacity)
345 return;
346 m_opacity = opacity;
347 setNeedsCommit();
348 }
349
350 bool LayerChromium::opacityIsAnimating() const
351 {
352 return m_layerAnimationController->isAnimatingProperty(CCActiveAnimation::Op acity);
353 }
354
355 void LayerChromium::setContentsOpaque(bool opaque)
356 {
357 if (m_contentsOpaque == opaque)
358 return;
359 m_contentsOpaque = opaque;
360 setNeedsDisplay();
361 }
362
363 void LayerChromium::setPosition(const FloatPoint& position)
364 {
365 if (m_position == position)
366 return;
367 m_position = position;
368 setNeedsCommit();
369 }
370
371 void LayerChromium::setSublayerTransform(const WebTransformationMatrix& sublayer Transform)
372 {
373 if (m_sublayerTransform == sublayerTransform)
374 return;
375 m_sublayerTransform = sublayerTransform;
376 setNeedsCommit();
377 }
378
379 void LayerChromium::setTransform(const WebTransformationMatrix& transform)
380 {
381 if (m_transform == transform)
382 return;
383 m_transform = transform;
384 setNeedsCommit();
385 }
386
387 bool LayerChromium::transformIsAnimating() const
388 {
389 return m_layerAnimationController->isAnimatingProperty(CCActiveAnimation::Tr ansform);
390 }
391
392 void LayerChromium::setScrollPosition(const IntPoint& scrollPosition)
393 {
394 if (m_scrollPosition == scrollPosition)
395 return;
396 m_scrollPosition = scrollPosition;
397 if (m_layerScrollClient)
398 m_layerScrollClient->didScroll();
399 setNeedsCommit();
400 }
401
402 void LayerChromium::setMaxScrollPosition(const IntSize& maxScrollPosition)
403 {
404 if (m_maxScrollPosition == maxScrollPosition)
405 return;
406 m_maxScrollPosition = maxScrollPosition;
407 setNeedsCommit();
408 }
409
410 void LayerChromium::setScrollable(bool scrollable)
411 {
412 if (m_scrollable == scrollable)
413 return;
414 m_scrollable = scrollable;
415 setNeedsCommit();
416 }
417
418 void LayerChromium::setShouldScrollOnMainThread(bool shouldScrollOnMainThread)
419 {
420 if (m_shouldScrollOnMainThread == shouldScrollOnMainThread)
421 return;
422 m_shouldScrollOnMainThread = shouldScrollOnMainThread;
423 setNeedsCommit();
424 }
425
426 void LayerChromium::setHaveWheelEventHandlers(bool haveWheelEventHandlers)
427 {
428 if (m_haveWheelEventHandlers == haveWheelEventHandlers)
429 return;
430 m_haveWheelEventHandlers = haveWheelEventHandlers;
431 setNeedsCommit();
432 }
433
434 void LayerChromium::setNonFastScrollableRegion(const Region& region)
435 {
436 if (m_nonFastScrollableRegion == region)
437 return;
438 m_nonFastScrollableRegion = region;
439 m_nonFastScrollableRegionChanged = true;
440 setNeedsCommit();
441 }
442
443 void LayerChromium::setDrawCheckerboardForMissingTiles(bool checkerboard)
444 {
445 if (m_drawCheckerboardForMissingTiles == checkerboard)
446 return;
447 m_drawCheckerboardForMissingTiles = checkerboard;
448 setNeedsCommit();
449 }
450
451 void LayerChromium::setForceRenderSurface(bool force)
452 {
453 if (m_forceRenderSurface == force)
454 return;
455 m_forceRenderSurface = force;
456 setNeedsCommit();
457 }
458
459 void LayerChromium::setImplTransform(const WebTransformationMatrix& transform)
460 {
461 if (m_implTransform == transform)
462 return;
463 m_implTransform = transform;
464 setNeedsCommit();
465 }
466
467 void LayerChromium::setDoubleSided(bool doubleSided)
468 {
469 if (m_doubleSided == doubleSided)
470 return;
471 m_doubleSided = doubleSided;
472 setNeedsCommit();
473 }
474
475 void LayerChromium::setIsDrawable(bool isDrawable)
476 {
477 if (m_isDrawable == isDrawable)
478 return;
479
480 m_isDrawable = isDrawable;
481 setNeedsCommit();
482 }
483
484 LayerChromium* LayerChromium::parent() const
485 {
486 return m_parent;
487 }
488
489 void LayerChromium::setNeedsDisplayRect(const FloatRect& dirtyRect)
490 {
491 m_updateRect.unite(dirtyRect);
492
493 // Simply mark the contents as dirty. For non-root layers, the call to
494 // setNeedsCommit will schedule a fresh compositing pass.
495 // For the root layer, setNeedsCommit has no effect.
496 if (!dirtyRect.isEmpty())
497 m_needsDisplay = true;
498
499 setNeedsCommit();
500 }
501
502 bool LayerChromium::descendantIsFixedToContainerLayer() const
503 {
504 for (size_t i = 0; i < m_children.size(); ++i) {
505 if (m_children[i]->fixedToContainerLayer() || m_children[i]->descendantI sFixedToContainerLayer())
506 return true;
507 }
508 return false;
509 }
510
511 void LayerChromium::setIsContainerForFixedPositionLayers(bool isContainerForFixe dPositionLayers)
512 {
513 if (m_isContainerForFixedPositionLayers == isContainerForFixedPositionLayers )
514 return;
515 m_isContainerForFixedPositionLayers = isContainerForFixedPositionLayers;
516
517 if (m_layerTreeHost && m_layerTreeHost->commitRequested())
518 return;
519
520 // Only request a commit if we have a fixed positioned descendant.
521 if (descendantIsFixedToContainerLayer())
522 setNeedsCommit();
523 }
524
525 void LayerChromium::setFixedToContainerLayer(bool fixedToContainerLayer)
526 {
527 if (m_fixedToContainerLayer == fixedToContainerLayer)
528 return;
529 m_fixedToContainerLayer = fixedToContainerLayer;
530 setNeedsCommit();
531 }
532
533 void LayerChromium::pushPropertiesTo(CCLayerImpl* layer)
534 {
535 layer->setAnchorPoint(m_anchorPoint);
536 layer->setAnchorPointZ(m_anchorPointZ);
537 layer->setBackgroundColor(m_backgroundColor);
538 layer->setBounds(m_bounds);
539 layer->setContentBounds(contentBounds());
540 layer->setDebugBorderColor(m_debugBorderColor);
541 layer->setDebugBorderWidth(m_debugBorderWidth);
542 layer->setDebugName(m_debugName);
543 layer->setDoubleSided(m_doubleSided);
544 layer->setDrawCheckerboardForMissingTiles(m_drawCheckerboardForMissingTiles) ;
545 layer->setForceRenderSurface(m_forceRenderSurface);
546 layer->setDrawsContent(drawsContent());
547 layer->setFilters(filters());
548 layer->setBackgroundFilters(backgroundFilters());
549 layer->setUseLCDText(m_useLCDText);
550 layer->setMasksToBounds(m_masksToBounds);
551 layer->setScrollable(m_scrollable);
552 layer->setShouldScrollOnMainThread(m_shouldScrollOnMainThread);
553 layer->setHaveWheelEventHandlers(m_haveWheelEventHandlers);
554 // Copying a Region is more expensive than most layer properties, since it i nvolves copying two Vectors that may be
555 // arbitrarily large depending on page content, so we only push the property if it's changed.
556 if (m_nonFastScrollableRegionChanged) {
557 layer->setNonFastScrollableRegion(m_nonFastScrollableRegion);
558 m_nonFastScrollableRegionChanged = false;
559 }
560 layer->setContentsOpaque(m_contentsOpaque);
561 if (!opacityIsAnimating())
562 layer->setOpacity(m_opacity);
563 layer->setPosition(m_position);
564 layer->setIsContainerForFixedPositionLayers(m_isContainerForFixedPositionLay ers);
565 layer->setFixedToContainerLayer(m_fixedToContainerLayer);
566 layer->setPreserves3D(preserves3D());
567 layer->setUseParentBackfaceVisibility(m_useParentBackfaceVisibility);
568 layer->setScrollPosition(m_scrollPosition);
569 layer->setMaxScrollPosition(m_maxScrollPosition);
570 layer->setSublayerTransform(m_sublayerTransform);
571 if (!transformIsAnimating())
572 layer->setTransform(m_transform);
573
574 // If the main thread commits multiple times before the impl thread actually draws, then damage tracking
575 // will become incorrect if we simply clobber the updateRect here. The CCLay erImpl's updateRect needs to
576 // accumulate (i.e. union) any update changes that have occurred on the main thread.
577 m_updateRect.uniteIfNonZero(layer->updateRect());
578 layer->setUpdateRect(m_updateRect);
579
580 layer->setScrollDelta(layer->scrollDelta() - layer->sentScrollDelta());
581 layer->setSentScrollDelta(IntSize());
582
583 layer->setStackingOrderChanged(m_stackingOrderChanged);
584
585 if (maskLayer())
586 maskLayer()->pushPropertiesTo(layer->maskLayer());
587 if (replicaLayer())
588 replicaLayer()->pushPropertiesTo(layer->replicaLayer());
589
590 m_layerAnimationController->pushAnimationUpdatesTo(layer->layerAnimationCont roller());
591
592 // Reset any state that should be cleared for the next update.
593 m_stackingOrderChanged = false;
594 m_updateRect = FloatRect();
595 }
596
597 scoped_ptr<CCLayerImpl> LayerChromium::createCCLayerImpl()
598 {
599 return CCLayerImpl::create(m_layerId);
600 }
601
602 bool LayerChromium::drawsContent() const
603 {
604 return m_isDrawable;
605 }
606
607 bool LayerChromium::needMoreUpdates()
608 {
609 return false;
610 }
611
612 bool LayerChromium::needsContentsScale() const
613 {
614 return false;
615 }
616
617 void LayerChromium::setDebugBorderColor(SkColor color)
618 {
619 m_debugBorderColor = color;
620 setNeedsCommit();
621 }
622
623 void LayerChromium::setDebugBorderWidth(float width)
624 {
625 m_debugBorderWidth = width;
626 setNeedsCommit();
627 }
628
629 void LayerChromium::setDebugName(const std::string& debugName)
630 {
631 m_debugName = debugName;
632 setNeedsCommit();
633 }
634
635 void LayerChromium::setContentsScale(float contentsScale)
636 {
637 if (!needsContentsScale() || m_contentsScale == contentsScale)
638 return;
639 m_contentsScale = contentsScale;
640
641 setNeedsDisplay();
642 }
643
644 void LayerChromium::setBoundsContainPageScale(bool boundsContainPageScale)
645 {
646 for (size_t i = 0; i < m_children.size(); ++i)
647 m_children[i]->setBoundsContainPageScale(boundsContainPageScale);
648
649 if (boundsContainPageScale == m_boundsContainPageScale)
650 return;
651
652 m_boundsContainPageScale = boundsContainPageScale;
653 setNeedsDisplay();
654 }
655
656 void LayerChromium::createRenderSurface()
657 {
658 ASSERT(!m_renderSurface);
659 m_renderSurface = make_scoped_ptr(new RenderSurfaceChromium(this));
660 setRenderTarget(this);
661 }
662
663 bool LayerChromium::descendantDrawsContent()
664 {
665 for (size_t i = 0; i < m_children.size(); ++i) {
666 if (m_children[i]->drawsContent() || m_children[i]->descendantDrawsConte nt())
667 return true;
668 }
669 return false;
670 }
671
672 int LayerChromium::id() const
673 {
674 return m_layerId;
675 }
676
677 float LayerChromium::opacity() const
678 {
679 return m_opacity;
680 }
681
682 void LayerChromium::setOpacityFromAnimation(float opacity)
683 {
684 // This is called due to an ongoing accelerated animation. Since this animat ion is
685 // also being run on the impl thread, there is no need to request a commit t o push
686 // this value over, so set the value directly rather than calling setOpacity .
687 m_opacity = opacity;
688 }
689
690 const WebKit::WebTransformationMatrix& LayerChromium::transform() const
691 {
692 return m_transform;
693 }
694
695 void LayerChromium::setTransformFromAnimation(const WebTransformationMatrix& tra nsform)
696 {
697 // This is called due to an ongoing accelerated animation. Since this animat ion is
698 // also being run on the impl thread, there is no need to request a commit t o push
699 // this value over, so set this value directly rather than calling setTransf orm.
700 m_transform = transform;
701 }
702
703 bool LayerChromium::addAnimation(scoped_ptr <CCActiveAnimation> animation)
704 {
705 // WebCore currently assumes that accelerated animations will start soon
706 // after the animation is added. However we cannot guarantee that if we do
707 // not have a layerTreeHost that will setNeedsCommit().
708 if (!m_layerTreeHost)
709 return false;
710
711 if (!CCSettings::acceleratedAnimationEnabled())
712 return false;
713
714 m_layerAnimationController->addAnimation(animation.Pass());
715 if (m_layerTreeHost) {
716 m_layerTreeHost->didAddAnimation();
717 setNeedsCommit();
718 }
719 return true;
720 }
721
722 void LayerChromium::pauseAnimation(int animationId, double timeOffset)
723 {
724 m_layerAnimationController->pauseAnimation(animationId, timeOffset);
725 setNeedsCommit();
726 }
727
728 void LayerChromium::removeAnimation(int animationId)
729 {
730 m_layerAnimationController->removeAnimation(animationId);
731 setNeedsCommit();
732 }
733
734 void LayerChromium::suspendAnimations(double monotonicTime)
735 {
736 m_layerAnimationController->suspendAnimations(monotonicTime);
737 setNeedsCommit();
738 }
739
740 void LayerChromium::resumeAnimations(double monotonicTime)
741 {
742 m_layerAnimationController->resumeAnimations(monotonicTime);
743 setNeedsCommit();
744 }
745
746 void LayerChromium::setLayerAnimationController(scoped_ptr<CCLayerAnimationContr oller> layerAnimationController)
747 {
748 m_layerAnimationController = layerAnimationController.Pass();
749 if (m_layerAnimationController) {
750 m_layerAnimationController->setClient(this);
751 m_layerAnimationController->setForceSync();
752 }
753 setNeedsCommit();
754 }
755
756 scoped_ptr<CCLayerAnimationController> LayerChromium::releaseLayerAnimationContr oller()
757 {
758 scoped_ptr<CCLayerAnimationController> toReturn = m_layerAnimationController .Pass();
759 m_layerAnimationController = CCLayerAnimationController::create(this);
760 return toReturn.Pass();
761 }
762
763 bool LayerChromium::hasActiveAnimation() const
764 {
765 return m_layerAnimationController->hasActiveAnimation();
766 }
767
768 void LayerChromium::notifyAnimationStarted(const CCAnimationEvent& event, double wallClockTime)
769 {
770 m_layerAnimationController->notifyAnimationStarted(event);
771 if (m_layerAnimationDelegate)
772 m_layerAnimationDelegate->notifyAnimationStarted(wallClockTime);
773 }
774
775 void LayerChromium::notifyAnimationFinished(double wallClockTime)
776 {
777 if (m_layerAnimationDelegate)
778 m_layerAnimationDelegate->notifyAnimationFinished(wallClockTime);
779 }
780
781 Region LayerChromium::visibleContentOpaqueRegion() const
782 {
783 if (contentsOpaque())
784 return visibleContentRect();
785 return Region();
786 }
787
788 ScrollbarLayerChromium* LayerChromium::toScrollbarLayerChromium()
789 {
790 return 0;
791 }
792
793 void sortLayers(std::vector<scoped_refptr<LayerChromium> >::iterator, std::vecto r<scoped_refptr<LayerChromium> >::iterator, void*)
794 {
795 // Currently we don't use z-order to decide what to paint, so there's no nee d to actually sort LayerChromiums.
796 }
797
798 }
799 #endif // USE(ACCELERATED_COMPOSITING)
OLDNEW
« no previous file with comments | « cc/LayerChromium.h ('k') | cc/LayerPainterChromium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698