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/layers/tiled_layer.h" | 5 #include "cc/layers/tiled_layer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 : partial_update(false), | 77 : partial_update(false), |
78 valid_for_frame(false), | 78 valid_for_frame(false), |
79 occluded(false), | 79 occluded(false), |
80 updater_resource_(updater_resource.Pass()) {} | 80 updater_resource_(updater_resource.Pass()) {} |
81 | 81 |
82 scoped_ptr<LayerUpdater::Resource> updater_resource_; | 82 scoped_ptr<LayerUpdater::Resource> updater_resource_; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(UpdatableTile); | 84 DISALLOW_COPY_AND_ASSIGN(UpdatableTile); |
85 }; | 85 }; |
86 | 86 |
87 TiledLayer::TiledLayer() | 87 TiledLayer::TiledLayer(const LayerSettings& settings) |
88 : ContentsScalingLayer(), | 88 : ContentsScalingLayer(settings), |
89 texture_format_(RGBA_8888), | 89 texture_format_(RGBA_8888), |
90 skips_draw_(false), | 90 skips_draw_(false), |
91 failed_update_(false), | 91 failed_update_(false), |
92 tiling_option_(AUTO_TILE) { | 92 tiling_option_(AUTO_TILE) { |
93 tiler_ = | 93 tiler_ = |
94 LayerTilingData::Create(gfx::Size(), LayerTilingData::HAS_BORDER_TEXELS); | 94 LayerTilingData::Create(gfx::Size(), LayerTilingData::HAS_BORDER_TEXELS); |
95 } | 95 } |
96 | 96 |
97 TiledLayer::~TiledLayer() {} | 97 TiledLayer::~TiledLayer() {} |
98 | 98 |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 gfx::Rect prepaint_rect = visible_content_rect(); | 860 gfx::Rect prepaint_rect = visible_content_rect(); |
861 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, | 861 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, |
862 -tiler_->tile_size().height() * kPrepaintRows); | 862 -tiler_->tile_size().height() * kPrepaintRows); |
863 gfx::Rect content_rect(content_bounds()); | 863 gfx::Rect content_rect(content_bounds()); |
864 prepaint_rect.Intersect(content_rect); | 864 prepaint_rect.Intersect(content_rect); |
865 | 865 |
866 return prepaint_rect; | 866 return prepaint_rect; |
867 } | 867 } |
868 | 868 |
869 } // namespace cc | 869 } // namespace cc |
OLD | NEW |