| 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 #ifndef CC_TEST_TILED_LAYER_TEST_COMMON_H_ | 5 #ifndef CC_TEST_TILED_LAYER_TEST_COMMON_H_ |
| 6 #define CC_TEST_TILED_LAYER_TEST_COMMON_H_ | 6 #define CC_TEST_TILED_LAYER_TEST_COMMON_H_ |
| 7 | 7 |
| 8 #include "cc/layer_updater.h" | 8 #include "cc/layer_updater.h" |
| 9 #include "cc/prioritized_resource.h" | 9 #include "cc/prioritized_resource.h" |
| 10 #include "cc/region.h" | 10 #include "cc/region.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 explicit FakeTiledLayer(cc::PrioritizedResourceManager*); | 83 explicit FakeTiledLayer(cc::PrioritizedResourceManager*); |
| 84 | 84 |
| 85 static gfx::Size tileSize() { return gfx::Size(100, 100); } | 85 static gfx::Size tileSize() { return gfx::Size(100, 100); } |
| 86 | 86 |
| 87 using cc::TiledLayer::invalidateContentRect; | 87 using cc::TiledLayer::invalidateContentRect; |
| 88 using cc::TiledLayer::needsIdlePaint; | 88 using cc::TiledLayer::needsIdlePaint; |
| 89 using cc::TiledLayer::skipsDraw; | 89 using cc::TiledLayer::skipsDraw; |
| 90 using cc::TiledLayer::numPaintedTiles; | 90 using cc::TiledLayer::numPaintedTiles; |
| 91 using cc::TiledLayer::idlePaintRect; | 91 using cc::TiledLayer::idlePaintRect; |
| 92 | 92 |
| 93 virtual void setNeedsDisplayRect(const gfx::RectF&) OVERRIDE; | 93 virtual void SetNeedsDisplayRect(const gfx::RectF&) OVERRIDE; |
| 94 const gfx::RectF& lastNeedsDisplayRect() const { return m_lastNeedsDisplayRe
ct; } | 94 const gfx::RectF& lastNeedsDisplayRect() const { return m_lastNeedsDisplayRe
ct; } |
| 95 | 95 |
| 96 virtual void setTexturePriorities(const cc::PriorityCalculator&) OVERRIDE; | 96 virtual void SetTexturePriorities(const cc::PriorityCalculator&) OVERRIDE; |
| 97 | 97 |
| 98 virtual cc::PrioritizedResourceManager* resourceManager() const OVERRIDE; | 98 virtual cc::PrioritizedResourceManager* resourceManager() const OVERRIDE; |
| 99 FakeLayerUpdater* fakeLayerUpdater() { return m_fakeUpdater.get(); } | 99 FakeLayerUpdater* fakeLayerUpdater() { return m_fakeUpdater.get(); } |
| 100 gfx::RectF updateRect() { return m_updateRect; } | 100 gfx::RectF updateRect() { return update_rect_; } |
| 101 | 101 |
| 102 // Simulate calcDrawProperties. | 102 // Simulate calcDrawProperties. |
| 103 void updateContentsScale(float idealContentsScale); | 103 void updateContentsScale(float idealContentsScale); |
| 104 | 104 |
| 105 protected: | 105 protected: |
| 106 virtual cc::LayerUpdater* updater() const OVERRIDE; | 106 virtual cc::LayerUpdater* updater() const OVERRIDE; |
| 107 virtual void createUpdaterIfNeeded() OVERRIDE { } | 107 virtual void createUpdaterIfNeeded() OVERRIDE { } |
| 108 virtual ~FakeTiledLayer(); | 108 virtual ~FakeTiledLayer(); |
| 109 | 109 |
| 110 private: | 110 private: |
| 111 scoped_refptr<FakeLayerUpdater> m_fakeUpdater; | 111 scoped_refptr<FakeLayerUpdater> m_fakeUpdater; |
| 112 cc::PrioritizedResourceManager* m_resourceManager; | 112 cc::PrioritizedResourceManager* m_resourceManager; |
| 113 gfx::RectF m_lastNeedsDisplayRect; | 113 gfx::RectF m_lastNeedsDisplayRect; |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 class FakeTiledLayerWithScaledBounds : public FakeTiledLayer { | 116 class FakeTiledLayerWithScaledBounds : public FakeTiledLayer { |
| 117 public: | 117 public: |
| 118 explicit FakeTiledLayerWithScaledBounds(cc::PrioritizedResourceManager*); | 118 explicit FakeTiledLayerWithScaledBounds(cc::PrioritizedResourceManager*); |
| 119 | 119 |
| 120 void setContentBounds(const gfx::Size& contentBounds); | 120 void setContentBounds(const gfx::Size& contentBounds); |
| 121 virtual void calculateContentsScale( | 121 virtual void CalculateContentsScale(float idealContentsScale, |
| 122 float idealContentsScale, | 122 bool animatingTransformToScreen, |
| 123 bool animatingTransformToScreen, | 123 float* contentsScaleX, |
| 124 float* contentsScaleX, | 124 float* contentsScaleY, |
| 125 float* contentsScaleY, | 125 gfx::Size* contentBounds) OVERRIDE; |
| 126 gfx::Size* contentBounds) OVERRIDE; | |
| 127 | 126 |
| 128 protected: | 127 protected: |
| 129 virtual ~FakeTiledLayerWithScaledBounds(); | 128 virtual ~FakeTiledLayerWithScaledBounds(); |
| 130 gfx::Size m_forcedContentBounds; | 129 gfx::Size m_forcedContentBounds; |
| 131 }; | 130 }; |
| 132 | 131 |
| 133 } // namespace cc | 132 } // namespace cc |
| 134 | 133 |
| 135 #endif // CC_TEST_TILED_LAYER_TEST_COMMON_H_ | 134 #endif // CC_TEST_TILED_LAYER_TEST_COMMON_H_ |
| OLD | NEW |