| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "cc/test/tiled_layer_test_common.h" | 7 #include "cc/test/tiled_layer_test_common.h" |
| 8 | 8 |
| 9 using namespace cc; | 9 using namespace cc; |
| 10 | 10 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 FakeTiledLayer::~FakeTiledLayer() | 100 FakeTiledLayer::~FakeTiledLayer() |
| 101 { | 101 { |
| 102 } | 102 } |
| 103 | 103 |
| 104 void FakeTiledLayer::setNeedsDisplayRect(const gfx::RectF& rect) | 104 void FakeTiledLayer::setNeedsDisplayRect(const gfx::RectF& rect) |
| 105 { | 105 { |
| 106 m_lastNeedsDisplayRect = rect; | 106 m_lastNeedsDisplayRect = rect; |
| 107 TiledLayer::setNeedsDisplayRect(rect); | 107 TiledLayer::setNeedsDisplayRect(rect); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void FakeTiledLayer::setCanUseLCDText(bool useLCDText) |
| 111 { |
| 112 // FIXME: Do not call TiledLayer::setCanUseLCDText, which changes border-tex
el option. |
| 113 // Otherwise tests that rely on NoBorderTexels data and count the number of
commits/updates will fail. |
| 114 // This will be fixed once we decouple using LCD text and border texels on t
iles. |
| 115 // crbug.com/160072 |
| 116 Layer::setCanUseLCDText(useLCDText); |
| 117 } |
| 118 |
| 110 void FakeTiledLayer::setTexturePriorities(const PriorityCalculator& calculator) | 119 void FakeTiledLayer::setTexturePriorities(const PriorityCalculator& calculator) |
| 111 { | 120 { |
| 112 // Ensure there is always a target render surface available. If none has bee
n | 121 // Ensure there is always a target render surface available. If none has bee
n |
| 113 // set (the layer is an orphan for the test), then just set a surface on its
elf. | 122 // set (the layer is an orphan for the test), then just set a surface on its
elf. |
| 114 bool missingTargetRenderSurface = !renderTarget(); | 123 bool missingTargetRenderSurface = !renderTarget(); |
| 115 | 124 |
| 116 if (missingTargetRenderSurface) | 125 if (missingTargetRenderSurface) |
| 117 createRenderSurface(); | 126 createRenderSurface(); |
| 118 | 127 |
| 119 TiledLayer::setTexturePriorities(calculator); | 128 TiledLayer::setTexturePriorities(calculator); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 148 { | 157 { |
| 149 return static_cast<float>(m_forcedContentBounds.height()) / bounds().height(
); | 158 return static_cast<float>(m_forcedContentBounds.height()) / bounds().height(
); |
| 150 } | 159 } |
| 151 | 160 |
| 152 void FakeTiledLayerWithScaledBounds::setContentsScale(float) | 161 void FakeTiledLayerWithScaledBounds::setContentsScale(float) |
| 153 { | 162 { |
| 154 NOTREACHED(); | 163 NOTREACHED(); |
| 155 } | 164 } |
| 156 | 165 |
| 157 } // namespace | 166 } // namespace |
| OLD | NEW |