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 "cc/image_layer.h" | 5 #include "cc/image_layer.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "cc/image_layer_updater.h" | 8 #include "cc/resources/image_layer_updater.h" |
9 #include "cc/layer_updater.h" | 9 #include "cc/resources/layer_updater.h" |
10 #include "cc/prioritized_resource.h" | 10 #include "cc/resources/prioritized_resource.h" |
11 #include "cc/resource_update_queue.h" | 11 #include "cc/resources/resource_update_queue.h" |
12 #include "cc/trees/layer_tree_host.h" | 12 #include "cc/trees/layer_tree_host.h" |
13 | 13 |
14 namespace cc { | 14 namespace cc { |
15 | 15 |
16 scoped_refptr<ImageLayer> ImageLayer::Create() { | 16 scoped_refptr<ImageLayer> ImageLayer::Create() { |
17 return make_scoped_refptr(new ImageLayer()); | 17 return make_scoped_refptr(new ImageLayer()); |
18 } | 18 } |
19 | 19 |
20 ImageLayer::ImageLayer() : TiledLayer() {} | 20 ImageLayer::ImageLayer() : TiledLayer() {} |
21 | 21 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 return static_cast<float>(bitmap_.width()) / bounds().width(); | 87 return static_cast<float>(bitmap_.width()) / bounds().width(); |
88 } | 88 } |
89 | 89 |
90 float ImageLayer::ImageContentsScaleY() const { | 90 float ImageLayer::ImageContentsScaleY() const { |
91 if (bounds().IsEmpty() || bitmap_.height() == 0) | 91 if (bounds().IsEmpty() || bitmap_.height() == 0) |
92 return 1; | 92 return 1; |
93 return static_cast<float>(bitmap_.height()) / bounds().height(); | 93 return static_cast<float>(bitmap_.height()) / bounds().height(); |
94 } | 94 } |
95 | 95 |
96 } // namespace cc | 96 } // namespace cc |
OLD | NEW |