Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/tiled_layer.h" | 5 #include "cc/tiled_layer.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "cc/layer_impl.h" | 9 #include "cc/layer_impl.h" |
| 10 #include "cc/layer_tree_host.h" | 10 #include "cc/layer_tree_host.h" |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 626 bound.Intersect(gfx::Rect(gfx::Point(), contentBounds())); | 626 bound.Intersect(gfx::Rect(gfx::Point(), contentBounds())); |
| 627 m_predictedVisibleRect.Intersect(bound); | 627 m_predictedVisibleRect.Intersect(bound); |
| 628 } | 628 } |
| 629 m_previousContentBounds = contentBounds(); | 629 m_previousContentBounds = contentBounds(); |
| 630 m_previousVisibleRect = visibleContentRect(); | 630 m_previousVisibleRect = visibleContentRect(); |
| 631 } | 631 } |
| 632 | 632 |
| 633 void TiledLayer::update(ResourceUpdateQueue& queue, const OcclusionTracker* occl usion, RenderingStats& stats) | 633 void TiledLayer::update(ResourceUpdateQueue& queue, const OcclusionTracker* occl usion, RenderingStats& stats) |
| 634 { | 634 { |
| 635 DCHECK(!m_skipsDraw && !m_failedUpdate); // Did resetUpdateState get skipped ? | 635 DCHECK(!m_skipsDraw && !m_failedUpdate); // Did resetUpdateState get skipped ? |
| 636 | |
| 637 ContentsScalingLayer::update(queue, occlusion, stats); | |
|
enne (OOO)
2012/12/19 23:57:24
You should do this in ScrollbarLayer too (but not
| |
| 638 | |
| 636 updateBounds(); | 639 updateBounds(); |
| 637 if (m_tiler->hasEmptyBounds() || !drawsContent()) | 640 if (m_tiler->hasEmptyBounds() || !drawsContent()) |
| 638 return; | 641 return; |
| 639 | 642 |
| 640 bool didPaint = false; | 643 bool didPaint = false; |
| 641 | 644 |
| 642 // Animation pre-paint. If the layer is small, try to paint it all | 645 // Animation pre-paint. If the layer is small, try to paint it all |
| 643 // immediately whether or not it is occluded, to avoid paint/upload | 646 // immediately whether or not it is occluded, to avoid paint/upload |
| 644 // hiccups while it is animating. | 647 // hiccups while it is animating. |
| 645 if (isSmallAnimatedLayer()) { | 648 if (isSmallAnimatedLayer()) { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 757 gfx::Rect prepaintRect = visibleContentRect(); | 760 gfx::Rect prepaintRect = visibleContentRect(); |
| 758 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns, | 761 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns, |
| 759 -m_tiler->tileSize().height() * prepaintRows); | 762 -m_tiler->tileSize().height() * prepaintRows); |
| 760 gfx::Rect contentRect(gfx::Point(), contentBounds()); | 763 gfx::Rect contentRect(gfx::Point(), contentBounds()); |
| 761 prepaintRect.Intersect(contentRect); | 764 prepaintRect.Intersect(contentRect); |
| 762 | 765 |
| 763 return prepaintRect; | 766 return prepaintRect; |
| 764 } | 767 } |
| 765 | 768 |
| 766 } // namespace cc | 769 } // namespace cc |
| OLD | NEW |