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 "CCTiledLayerTestCommon.h" | 7 #include "CCTiledLayerTestCommon.h" |
8 | 8 |
9 using namespace WebCore; | 9 using namespace WebCore; |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 { | 58 { |
59 m_rectToInvalidate = rect; | 59 m_rectToInvalidate = rect; |
60 m_layer = layer; | 60 m_layer = layer; |
61 } | 61 } |
62 | 62 |
63 PassOwnPtr<LayerTextureUpdater::Texture> FakeLayerTextureUpdater::createTexture(
CCPrioritizedTextureManager* manager) | 63 PassOwnPtr<LayerTextureUpdater::Texture> FakeLayerTextureUpdater::createTexture(
CCPrioritizedTextureManager* manager) |
64 { | 64 { |
65 return adoptPtr(new Texture(this, CCPrioritizedTexture::create(manager))); | 65 return adoptPtr(new Texture(this, CCPrioritizedTexture::create(manager))); |
66 } | 66 } |
67 | 67 |
| 68 LayerTextureUpdater::SampledTexelFormat FakeLayerTextureUpdater::sampledTexelFor
mat(GC3Denum) |
| 69 { |
| 70 return SampledTexelFormatRGBA; |
| 71 } |
| 72 |
68 FakeCCTiledLayerImpl::FakeCCTiledLayerImpl(int id) | 73 FakeCCTiledLayerImpl::FakeCCTiledLayerImpl(int id) |
69 : CCTiledLayerImpl(id) | 74 : CCTiledLayerImpl(id) |
70 { | 75 { |
71 } | 76 } |
72 | 77 |
73 FakeCCTiledLayerImpl::~FakeCCTiledLayerImpl() | 78 FakeCCTiledLayerImpl::~FakeCCTiledLayerImpl() |
74 { | 79 { |
75 } | 80 } |
76 | 81 |
77 FakeTiledLayerChromium::FakeTiledLayerChromium(CCPrioritizedTextureManager* text
ureManager) | 82 FakeTiledLayerChromium::FakeTiledLayerChromium(CCPrioritizedTextureManager* text
ureManager) |
78 : TiledLayerChromium() | 83 : TiledLayerChromium() |
79 , m_fakeTextureUpdater(adoptRef(new FakeLayerTextureUpdater)) | 84 , m_fakeTextureUpdater(adoptRef(new FakeLayerTextureUpdater)) |
80 , m_textureManager(textureManager) | 85 , m_textureManager(textureManager) |
81 { | 86 { |
82 setTileSize(tileSize()); | 87 setTileSize(tileSize()); |
83 setTextureFormat(GraphicsContext3D::RGBA); | 88 setTextureFormat(GraphicsContext3D::RGBA); |
84 setBorderTexelOption(CCLayerTilingData::NoBorderTexels); | 89 setBorderTexelOption(CCLayerTilingData::NoBorderTexels); |
85 setIsDrawable(true); // So that we don't get false positives if any of these
tests expect to return false from drawsContent() for other reasons. | 90 setIsDrawable(true); // So that we don't get false positives if any of these
tests expect to return false from drawsContent() for other reasons. |
86 } | 91 } |
87 | 92 |
| 93 FakeTiledLayerWithScaledBounds::FakeTiledLayerWithScaledBounds(CCPrioritizedText
ureManager* textureManager) |
| 94 : FakeTiledLayerChromium(textureManager) |
| 95 { |
| 96 } |
| 97 |
88 FakeTiledLayerChromium::~FakeTiledLayerChromium() | 98 FakeTiledLayerChromium::~FakeTiledLayerChromium() |
89 { | 99 { |
90 } | 100 } |
91 | 101 |
92 void FakeTiledLayerChromium::setNeedsDisplayRect(const FloatRect& rect) | 102 void FakeTiledLayerChromium::setNeedsDisplayRect(const FloatRect& rect) |
93 { | 103 { |
94 m_lastNeedsDisplayRect = rect; | 104 m_lastNeedsDisplayRect = rect; |
95 TiledLayerChromium::setNeedsDisplayRect(rect); | 105 TiledLayerChromium::setNeedsDisplayRect(rect); |
96 } | 106 } |
97 | 107 |
98 void FakeTiledLayerChromium::setTexturePriorities(const CCPriorityCalculator& ca
lculator) | 108 void FakeTiledLayerChromium::setTexturePriorities(const CCPriorityCalculator& ca
lculator) |
99 { | 109 { |
100 // Ensure there is always a target render surface available. If none has bee
n | 110 // Ensure there is always a target render surface available. If none has bee
n |
101 // set (the layer is an orphan for the test), then just set a surface on its
elf. | 111 // set (the layer is an orphan for the test), then just set a surface on its
elf. |
102 bool missingTargetRenderSurface = !renderTarget(); | 112 bool missingTargetRenderSurface = !renderTarget(); |
103 | 113 |
104 if (missingTargetRenderSurface) | 114 if (missingTargetRenderSurface) |
105 createRenderSurface(); | 115 createRenderSurface(); |
106 | 116 |
107 TiledLayerChromium::setTexturePriorities(calculator); | 117 TiledLayerChromium::setTexturePriorities(calculator); |
108 | 118 |
109 if (missingTargetRenderSurface) { | 119 if (missingTargetRenderSurface) { |
110 clearRenderSurface(); | 120 clearRenderSurface(); |
111 setRenderTarget(0); | 121 setRenderTarget(0); |
112 } | 122 } |
113 } | 123 } |
114 | 124 |
115 FakeTiledLayerWithScaledBounds::FakeTiledLayerWithScaledBounds(CCPrioritizedText
ureManager* textureManager) | 125 WebCore::CCPrioritizedTextureManager* FakeTiledLayerChromium::textureManager() c
onst |
116 : FakeTiledLayerChromium(textureManager) | |
117 { | 126 { |
| 127 return m_textureManager; |
| 128 } |
| 129 |
| 130 WebCore::LayerTextureUpdater* FakeTiledLayerChromium::textureUpdater() const |
| 131 { |
| 132 return m_fakeTextureUpdater.get(); |
| 133 } |
| 134 |
| 135 WebCore::IntSize FakeTiledLayerWithScaledBounds::contentBounds() const |
| 136 { |
| 137 return m_forcedContentBounds; |
| 138 } |
| 139 |
| 140 bool FakeTextureUploader::isBusy() |
| 141 { |
| 142 return false; |
| 143 } |
| 144 |
| 145 void FakeTextureUploader::uploadTexture(WebCore::CCResourceProvider* resourcePro
vider, Parameters upload) |
| 146 { |
| 147 upload.texture->updateRect(resourceProvider, upload.sourceRect, upload.destO
ffset); |
118 } | 148 } |
119 | 149 |
120 } // namespace | 150 } // namespace |
OLD | NEW |