| 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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1579 // contents of its texture are updated as the last thing before the frame is | 1579 // contents of its texture are updated as the last thing before the frame is |
| 1580 // drawn. | 1580 // drawn. |
| 1581 if (active_tree_->hud_layer()) { | 1581 if (active_tree_->hud_layer()) { |
| 1582 TRACE_EVENT0("cc", "DrawLayers.UpdateHudTexture"); | 1582 TRACE_EVENT0("cc", "DrawLayers.UpdateHudTexture"); |
| 1583 active_tree_->hud_layer()->UpdateHudTexture(draw_mode, | 1583 active_tree_->hud_layer()->UpdateHudTexture(draw_mode, |
| 1584 resource_provider_.get()); | 1584 resource_provider_.get()); |
| 1585 } | 1585 } |
| 1586 | 1586 |
| 1587 if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE) { | 1587 if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE) { |
| 1588 bool disable_picture_quad_image_filtering = | 1588 bool disable_picture_quad_image_filtering = |
| 1589 IsCurrentlyScrolling() || needs_animate_layers(); | 1589 IsActivelyScrolling() || needs_animate_layers(); |
| 1590 | 1590 |
| 1591 scoped_ptr<SoftwareRenderer> temp_software_renderer = | 1591 scoped_ptr<SoftwareRenderer> temp_software_renderer = |
| 1592 SoftwareRenderer::Create(this, &settings_, output_surface_.get(), NULL); | 1592 SoftwareRenderer::Create(this, &settings_, output_surface_.get(), NULL); |
| 1593 temp_software_renderer->DrawFrame(&frame->render_passes, | 1593 temp_software_renderer->DrawFrame(&frame->render_passes, |
| 1594 device_scale_factor_, | 1594 device_scale_factor_, |
| 1595 DeviceViewport(), | 1595 DeviceViewport(), |
| 1596 DeviceClip(), | 1596 DeviceClip(), |
| 1597 disable_picture_quad_image_filtering); | 1597 disable_picture_quad_image_filtering); |
| 1598 } else { | 1598 } else { |
| 1599 renderer_->DrawFrame(&frame->render_passes, | 1599 renderer_->DrawFrame(&frame->render_passes, |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1761 } | 1761 } |
| 1762 | 1762 |
| 1763 LayerImpl* LayerTreeHostImpl::OuterViewportScrollLayer() const { | 1763 LayerImpl* LayerTreeHostImpl::OuterViewportScrollLayer() const { |
| 1764 return active_tree_->OuterViewportScrollLayer(); | 1764 return active_tree_->OuterViewportScrollLayer(); |
| 1765 } | 1765 } |
| 1766 | 1766 |
| 1767 LayerImpl* LayerTreeHostImpl::CurrentlyScrollingLayer() const { | 1767 LayerImpl* LayerTreeHostImpl::CurrentlyScrollingLayer() const { |
| 1768 return active_tree_->CurrentlyScrollingLayer(); | 1768 return active_tree_->CurrentlyScrollingLayer(); |
| 1769 } | 1769 } |
| 1770 | 1770 |
| 1771 bool LayerTreeHostImpl::IsCurrentlyScrolling() const { | 1771 bool LayerTreeHostImpl::IsActivelyScrolling() const { |
| 1772 return CurrentlyScrollingLayer() || | 1772 return (did_lock_scrolling_layer_ && CurrentlyScrollingLayer()) || |
| 1773 (InnerViewportScrollLayer() && | 1773 (InnerViewportScrollLayer() && |
| 1774 InnerViewportScrollLayer()->IsExternalFlingActive()) || | 1774 InnerViewportScrollLayer()->IsExternalFlingActive()) || |
| 1775 (OuterViewportScrollLayer() && | 1775 (OuterViewportScrollLayer() && |
| 1776 OuterViewportScrollLayer()->IsExternalFlingActive()); | 1776 OuterViewportScrollLayer()->IsExternalFlingActive()); |
| 1777 } | 1777 } |
| 1778 | 1778 |
| 1779 // Content layers can be either directly scrollable or contained in an outer | 1779 // Content layers can be either directly scrollable or contained in an outer |
| 1780 // scrolling layer which applies the scroll transform. Given a content layer, | 1780 // scrolling layer which applies the scroll transform. Given a content layer, |
| 1781 // this function returns the associated scroll layer if any. | 1781 // this function returns the associated scroll layer if any. |
| 1782 static LayerImpl* FindScrollLayerForContentLayer(LayerImpl* layer_impl) { | 1782 static LayerImpl* FindScrollLayerForContentLayer(LayerImpl* layer_impl) { |
| (...skipping 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3478 } | 3478 } |
| 3479 | 3479 |
| 3480 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3480 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3481 std::vector<PictureLayerImpl*>::iterator it = | 3481 std::vector<PictureLayerImpl*>::iterator it = |
| 3482 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3482 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3483 DCHECK(it != picture_layers_.end()); | 3483 DCHECK(it != picture_layers_.end()); |
| 3484 picture_layers_.erase(it); | 3484 picture_layers_.erase(it); |
| 3485 } | 3485 } |
| 3486 | 3486 |
| 3487 } // namespace cc | 3487 } // namespace cc |
| OLD | NEW |