| 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/image_layer_updater.h" |
| 9 #include "cc/layer_updater.h" | 9 #include "cc/layer_updater.h" |
| 10 #include "cc/layer_tree_host.h" | 10 #include "cc/layer_tree_host.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 | 42 |
| 43 void ImageLayer::setTexturePriorities(const PriorityCalculator& priorityCalc) | 43 void ImageLayer::setTexturePriorities(const PriorityCalculator& priorityCalc) |
| 44 { | 44 { |
| 45 // Update the tile data before creating all the layer's tiles. | 45 // Update the tile data before creating all the layer's tiles. |
| 46 updateTileSizeAndTilingOption(); | 46 updateTileSizeAndTilingOption(); |
| 47 | 47 |
| 48 TiledLayer::setTexturePriorities(priorityCalc); | 48 TiledLayer::setTexturePriorities(priorityCalc); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void ImageLayer::update(ResourceUpdateQueue& queue, const OcclusionTracker* occl
usion, RenderingStats& stats) | 51 void ImageLayer::update(ResourceUpdateQueue& queue, const OcclusionTracker* occl
usion, RenderingStats* stats) |
| 52 { | 52 { |
| 53 createUpdaterIfNeeded(); | 53 createUpdaterIfNeeded(); |
| 54 if (m_needsDisplay) { | 54 if (m_needsDisplay) { |
| 55 m_updater->setBitmap(m_bitmap); | 55 m_updater->setBitmap(m_bitmap); |
| 56 updateTileSizeAndTilingOption(); | 56 updateTileSizeAndTilingOption(); |
| 57 invalidateContentRect(gfx::Rect(gfx::Point(), contentBounds())); | 57 invalidateContentRect(gfx::Rect(gfx::Point(), contentBounds())); |
| 58 m_needsDisplay = false; | 58 m_needsDisplay = false; |
| 59 } | 59 } |
| 60 TiledLayer::update(queue, occlusion, stats); | 60 TiledLayer::update(queue, occlusion, stats); |
| 61 } | 61 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 } | 99 } |
| 100 | 100 |
| 101 float ImageLayer::imageContentsScaleY() const | 101 float ImageLayer::imageContentsScaleY() const |
| 102 { | 102 { |
| 103 if (bounds().IsEmpty() || m_bitmap.height() == 0) | 103 if (bounds().IsEmpty() || m_bitmap.height() == 0) |
| 104 return 1; | 104 return 1; |
| 105 return static_cast<float>(m_bitmap.height()) / bounds().height(); | 105 return static_cast<float>(m_bitmap.height()) / bounds().height(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace cc | 108 } // namespace cc |
| OLD | NEW |