| 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/content_layer.h" | 5 #include "cc/content_layer.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" |
| 7 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 8 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 9 #include "base/time.h" | 10 #include "base/time.h" |
| 10 #include "cc/bitmap_content_layer_updater.h" | 11 #include "cc/bitmap_content_layer_updater.h" |
| 11 #include "cc/bitmap_skpicture_content_layer_updater.h" | 12 #include "cc/bitmap_skpicture_content_layer_updater.h" |
| 12 #include "cc/content_layer_client.h" | 13 #include "cc/content_layer_client.h" |
| 13 #include "cc/layer_painter.h" | 14 #include "cc/layer_painter.h" |
| 14 #include "cc/layer_tree_host.h" | 15 #include "cc/layer_tree_host.h" |
| 15 | 16 |
| 16 namespace cc { | 17 namespace cc { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 void ContentLayer::setTexturePriorities(const PriorityCalculator& priorityCalc) | 63 void ContentLayer::setTexturePriorities(const PriorityCalculator& priorityCalc) |
| 63 { | 64 { |
| 64 // Update the tile data before creating all the layer's tiles. | 65 // Update the tile data before creating all the layer's tiles. |
| 65 updateTileSizeAndTilingOption(); | 66 updateTileSizeAndTilingOption(); |
| 66 | 67 |
| 67 TiledLayer::setTexturePriorities(priorityCalc); | 68 TiledLayer::setTexturePriorities(priorityCalc); |
| 68 } | 69 } |
| 69 | 70 |
| 70 void ContentLayer::update(ResourceUpdateQueue& queue, const OcclusionTracker* oc
clusion, RenderingStats& stats) | 71 void ContentLayer::update(ResourceUpdateQueue& queue, const OcclusionTracker* oc
clusion, RenderingStats& stats) |
| 71 { | 72 { |
| 72 createUpdaterIfNeeded(); | 73 { |
| 73 updateUseLCDText(); | 74 base::AutoReset<bool> ignoreSetNeedsCommit(&m_ignoreSetNeedsCommit, true
); |
| 75 |
| 76 createUpdaterIfNeeded(); |
| 77 updateUseLCDText(); |
| 78 } |
| 74 | 79 |
| 75 TiledLayer::update(queue, occlusion, stats); | 80 TiledLayer::update(queue, occlusion, stats); |
| 76 m_needsDisplay = false; | 81 m_needsDisplay = false; |
| 77 } | 82 } |
| 78 | 83 |
| 79 bool ContentLayer::needMoreUpdates() | 84 bool ContentLayer::needMoreUpdates() |
| 80 { | 85 { |
| 81 return needsIdlePaint(); | 86 return needsIdlePaint(); |
| 82 } | 87 } |
| 83 | 88 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // it does not really cause any invalidation. | 143 // it does not really cause any invalidation. |
| 139 TRACE_EVENT_INSTANT0("cc", "ContentLayer::canUseLCDTextDidChange"); | 144 TRACE_EVENT_INSTANT0("cc", "ContentLayer::canUseLCDTextDidChange"); |
| 140 } | 145 } |
| 141 ++m_lcdTextChangeCount; | 146 ++m_lcdTextChangeCount; |
| 142 | 147 |
| 143 // Need to repaint the layer with different text AA setting. | 148 // Need to repaint the layer with different text AA setting. |
| 144 setNeedsDisplay(); | 149 setNeedsDisplay(); |
| 145 } | 150 } |
| 146 | 151 |
| 147 } // namespace cc | 152 } // namespace cc |
| OLD | NEW |