OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #if USE(ACCELERATED_COMPOSITING) | 7 #if USE(ACCELERATED_COMPOSITING) |
8 #include "LayerChromium.h" | 8 #include "LayerChromium.h" |
9 | 9 |
10 #include "CCActiveAnimation.h" | 10 #include "CCActiveAnimation.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 } | 255 } |
256 | 256 |
257 void LayerChromium::setBackgroundColor(SkColor backgroundColor) | 257 void LayerChromium::setBackgroundColor(SkColor backgroundColor) |
258 { | 258 { |
259 if (m_backgroundColor == backgroundColor) | 259 if (m_backgroundColor == backgroundColor) |
260 return; | 260 return; |
261 m_backgroundColor = backgroundColor; | 261 m_backgroundColor = backgroundColor; |
262 setNeedsCommit(); | 262 setNeedsCommit(); |
263 } | 263 } |
264 | 264 |
| 265 IntSize LayerChromium::contentBounds() const |
| 266 { |
| 267 return bounds(); |
| 268 } |
| 269 |
265 void LayerChromium::setMasksToBounds(bool masksToBounds) | 270 void LayerChromium::setMasksToBounds(bool masksToBounds) |
266 { | 271 { |
267 if (m_masksToBounds == masksToBounds) | 272 if (m_masksToBounds == masksToBounds) |
268 return; | 273 return; |
269 m_masksToBounds = masksToBounds; | 274 m_masksToBounds = masksToBounds; |
270 setNeedsCommit(); | 275 setNeedsCommit(); |
271 } | 276 } |
272 | 277 |
273 void LayerChromium::setMaskLayer(LayerChromium* maskLayer) | 278 void LayerChromium::setMaskLayer(LayerChromium* maskLayer) |
274 { | 279 { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 void LayerChromium::setBackgroundFilters(const WebKit::WebFilterOperations& back
groundFilters) | 314 void LayerChromium::setBackgroundFilters(const WebKit::WebFilterOperations& back
groundFilters) |
310 { | 315 { |
311 if (m_backgroundFilters == backgroundFilters) | 316 if (m_backgroundFilters == backgroundFilters) |
312 return; | 317 return; |
313 m_backgroundFilters = backgroundFilters; | 318 m_backgroundFilters = backgroundFilters; |
314 setNeedsCommit(); | 319 setNeedsCommit(); |
315 if (!backgroundFilters.isEmpty()) | 320 if (!backgroundFilters.isEmpty()) |
316 CCLayerTreeHost::setNeedsFilterContext(true); | 321 CCLayerTreeHost::setNeedsFilterContext(true); |
317 } | 322 } |
318 | 323 |
| 324 bool LayerChromium::needsDisplay() const |
| 325 { |
| 326 return m_needsDisplay; |
| 327 } |
| 328 |
319 void LayerChromium::setOpacity(float opacity) | 329 void LayerChromium::setOpacity(float opacity) |
320 { | 330 { |
321 if (m_opacity == opacity) | 331 if (m_opacity == opacity) |
322 return; | 332 return; |
323 m_opacity = opacity; | 333 m_opacity = opacity; |
324 setNeedsCommit(); | 334 setNeedsCommit(); |
325 } | 335 } |
326 | 336 |
327 bool LayerChromium::opacityIsAnimating() const | 337 bool LayerChromium::opacityIsAnimating() const |
328 { | 338 { |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 // Reset any state that should be cleared for the next update. | 571 // Reset any state that should be cleared for the next update. |
562 m_stackingOrderChanged = false; | 572 m_stackingOrderChanged = false; |
563 m_updateRect = FloatRect(); | 573 m_updateRect = FloatRect(); |
564 } | 574 } |
565 | 575 |
566 PassOwnPtr<CCLayerImpl> LayerChromium::createCCLayerImpl() | 576 PassOwnPtr<CCLayerImpl> LayerChromium::createCCLayerImpl() |
567 { | 577 { |
568 return CCLayerImpl::create(m_layerId); | 578 return CCLayerImpl::create(m_layerId); |
569 } | 579 } |
570 | 580 |
| 581 bool LayerChromium::drawsContent() const |
| 582 { |
| 583 return m_isDrawable; |
| 584 } |
| 585 |
| 586 bool LayerChromium::needMoreUpdates() |
| 587 { |
| 588 return false; |
| 589 } |
| 590 |
| 591 bool LayerChromium::needsContentsScale() const |
| 592 { |
| 593 return false; |
| 594 } |
| 595 |
571 void LayerChromium::setDebugBorderColor(SkColor color) | 596 void LayerChromium::setDebugBorderColor(SkColor color) |
572 { | 597 { |
573 m_debugBorderColor = color; | 598 m_debugBorderColor = color; |
574 setNeedsCommit(); | 599 setNeedsCommit(); |
575 } | 600 } |
576 | 601 |
577 void LayerChromium::setDebugBorderWidth(float width) | 602 void LayerChromium::setDebugBorderWidth(float width) |
578 { | 603 { |
579 m_debugBorderWidth = width; | 604 m_debugBorderWidth = width; |
580 setNeedsCommit(); | 605 setNeedsCommit(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 | 638 |
614 bool LayerChromium::descendantDrawsContent() | 639 bool LayerChromium::descendantDrawsContent() |
615 { | 640 { |
616 for (size_t i = 0; i < m_children.size(); ++i) { | 641 for (size_t i = 0; i < m_children.size(); ++i) { |
617 if (m_children[i]->drawsContent() || m_children[i]->descendantDrawsConte
nt()) | 642 if (m_children[i]->drawsContent() || m_children[i]->descendantDrawsConte
nt()) |
618 return true; | 643 return true; |
619 } | 644 } |
620 return false; | 645 return false; |
621 } | 646 } |
622 | 647 |
| 648 int LayerChromium::id() const |
| 649 { |
| 650 return m_layerId; |
| 651 } |
| 652 |
| 653 float LayerChromium::opacity() const |
| 654 { |
| 655 return m_opacity; |
| 656 } |
| 657 |
623 void LayerChromium::setOpacityFromAnimation(float opacity) | 658 void LayerChromium::setOpacityFromAnimation(float opacity) |
624 { | 659 { |
625 // This is called due to an ongoing accelerated animation. Since this animat
ion is | 660 // This is called due to an ongoing accelerated animation. Since this animat
ion is |
626 // also being run on the impl thread, there is no need to request a commit t
o push | 661 // also being run on the impl thread, there is no need to request a commit t
o push |
627 // this value over, so set the value directly rather than calling setOpacity
. | 662 // this value over, so set the value directly rather than calling setOpacity
. |
628 m_opacity = opacity; | 663 m_opacity = opacity; |
629 } | 664 } |
630 | 665 |
| 666 const WebKit::WebTransformationMatrix& LayerChromium::transform() const |
| 667 { |
| 668 return m_transform; |
| 669 } |
| 670 |
631 void LayerChromium::setTransformFromAnimation(const WebTransformationMatrix& tra
nsform) | 671 void LayerChromium::setTransformFromAnimation(const WebTransformationMatrix& tra
nsform) |
632 { | 672 { |
633 // This is called due to an ongoing accelerated animation. Since this animat
ion is | 673 // This is called due to an ongoing accelerated animation. Since this animat
ion is |
634 // also being run on the impl thread, there is no need to request a commit t
o push | 674 // also being run on the impl thread, there is no need to request a commit t
o push |
635 // this value over, so set this value directly rather than calling setTransf
orm. | 675 // this value over, so set this value directly rather than calling setTransf
orm. |
636 m_transform = transform; | 676 m_transform = transform; |
637 } | 677 } |
638 | 678 |
639 bool LayerChromium::addAnimation(PassOwnPtr<CCActiveAnimation> animation) | 679 bool LayerChromium::addAnimation(PassOwnPtr<CCActiveAnimation> animation) |
640 { | 680 { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 m_layerAnimationDelegate->notifyAnimationFinished(wallClockTime); | 754 m_layerAnimationDelegate->notifyAnimationFinished(wallClockTime); |
715 } | 755 } |
716 | 756 |
717 Region LayerChromium::visibleContentOpaqueRegion() const | 757 Region LayerChromium::visibleContentOpaqueRegion() const |
718 { | 758 { |
719 if (opaque()) | 759 if (opaque()) |
720 return visibleContentRect(); | 760 return visibleContentRect(); |
721 return Region(); | 761 return Region(); |
722 } | 762 } |
723 | 763 |
| 764 ScrollbarLayerChromium* LayerChromium::toScrollbarLayerChromium() |
| 765 { |
| 766 return 0; |
| 767 } |
| 768 |
724 void sortLayers(Vector<RefPtr<LayerChromium> >::iterator, Vector<RefPtr<LayerChr
omium> >::iterator, void*) | 769 void sortLayers(Vector<RefPtr<LayerChromium> >::iterator, Vector<RefPtr<LayerChr
omium> >::iterator, void*) |
725 { | 770 { |
726 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort LayerChromiums. | 771 // Currently we don't use z-order to decide what to paint, so there's no nee
d to actually sort LayerChromiums. |
727 } | 772 } |
728 | 773 |
729 } | 774 } |
730 #endif // USE(ACCELERATED_COMPOSITING) | 775 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |