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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 , m_failedUpdate(false) | 88 , m_failedUpdate(false) |
89 , m_tilingOption(AutoTile) | 89 , m_tilingOption(AutoTile) |
90 { | 90 { |
91 m_tiler = LayerTilingData::create(gfx::Size(), LayerTilingData::HasBorderTex
els); | 91 m_tiler = LayerTilingData::create(gfx::Size(), LayerTilingData::HasBorderTex
els); |
92 } | 92 } |
93 | 93 |
94 TiledLayer::~TiledLayer() | 94 TiledLayer::~TiledLayer() |
95 { | 95 { |
96 } | 96 } |
97 | 97 |
98 scoped_ptr<LayerImpl> TiledLayer::createLayerImpl() | 98 scoped_ptr<LayerImpl> TiledLayer::createLayerImpl(LayerTreeHostImpl* hostImpl) |
99 { | 99 { |
100 return TiledLayerImpl::create(id()).PassAs<LayerImpl>(); | 100 return TiledLayerImpl::create(hostImpl, id()).PassAs<LayerImpl>(); |
101 } | 101 } |
102 | 102 |
103 void TiledLayer::updateTileSizeAndTilingOption() | 103 void TiledLayer::updateTileSizeAndTilingOption() |
104 { | 104 { |
105 DCHECK(layerTreeHost()); | 105 DCHECK(layerTreeHost()); |
106 | 106 |
107 gfx::Size defaultTileSize = layerTreeHost()->settings().defaultTileSize; | 107 gfx::Size defaultTileSize = layerTreeHost()->settings().defaultTileSize; |
108 gfx::Size maxUntiledLayerSize = layerTreeHost()->settings().maxUntiledLayerS
ize; | 108 gfx::Size maxUntiledLayerSize = layerTreeHost()->settings().maxUntiledLayerS
ize; |
109 int layerWidth = contentBounds().width(); | 109 int layerWidth = contentBounds().width(); |
110 int layerHeight = contentBounds().height(); | 110 int layerHeight = contentBounds().height(); |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 gfx::Rect prepaintRect = visibleContentRect(); | 752 gfx::Rect prepaintRect = visibleContentRect(); |
753 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns, | 753 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns, |
754 -m_tiler->tileSize().height() * prepaintRows); | 754 -m_tiler->tileSize().height() * prepaintRows); |
755 gfx::Rect contentRect(gfx::Point(), contentBounds()); | 755 gfx::Rect contentRect(gfx::Point(), contentBounds()); |
756 prepaintRect.Intersect(contentRect); | 756 prepaintRect.Intersect(contentRect); |
757 | 757 |
758 return prepaintRect; | 758 return prepaintRect; |
759 } | 759 } |
760 | 760 |
761 } // namespace cc | 761 } // namespace cc |
OLD | NEW |