OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "CCLayerTreeHostImpl.h" | 7 #include "CCLayerTreeHostImpl.h" |
8 | 8 |
9 #include "CCAnimationTestCommon.h" | 9 #include "CCAnimationTestCommon.h" |
10 #include "CCGeometryTestUtils.h" | 10 #include "CCGeometryTestUtils.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "CCTiledLayerImpl.h" | 27 #include "CCTiledLayerImpl.h" |
28 #include "CCVideoLayerImpl.h" | 28 #include "CCVideoLayerImpl.h" |
29 #include "FakeWebCompositorOutputSurface.h" | 29 #include "FakeWebCompositorOutputSurface.h" |
30 #include "FakeWebGraphicsContext3D.h" | 30 #include "FakeWebGraphicsContext3D.h" |
31 #include "FakeWebScrollbarThemeGeometry.h" | 31 #include "FakeWebScrollbarThemeGeometry.h" |
32 #include <gmock/gmock.h> | 32 #include <gmock/gmock.h> |
33 #include <gtest/gtest.h> | 33 #include <gtest/gtest.h> |
34 #include <public/WebVideoFrame.h> | 34 #include <public/WebVideoFrame.h> |
35 #include <public/WebVideoFrameProvider.h> | 35 #include <public/WebVideoFrameProvider.h> |
36 | 36 |
| 37 using namespace cc; |
37 using namespace CCLayerTestCommon; | 38 using namespace CCLayerTestCommon; |
38 using namespace WebCore; | |
39 using namespace WebKit; | 39 using namespace WebKit; |
40 using namespace WebKitTests; | 40 using namespace WebKitTests; |
41 | 41 |
42 using ::testing::Mock; | 42 using ::testing::Mock; |
43 using ::testing::Return; | 43 using ::testing::Return; |
44 using ::testing::AnyNumber; | 44 using ::testing::AnyNumber; |
45 using ::testing::AtLeast; | 45 using ::testing::AtLeast; |
46 using ::testing::_; | 46 using ::testing::_; |
47 | 47 |
48 namespace { | 48 namespace { |
(...skipping 2051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2100 } | 2100 } |
2101 | 2101 |
2102 WebString getRequestableExtensionsCHROMIUM() | 2102 WebString getRequestableExtensionsCHROMIUM() |
2103 { | 2103 { |
2104 return WebString("GL_CHROMIUM_post_sub_buffer"); | 2104 return WebString("GL_CHROMIUM_post_sub_buffer"); |
2105 } | 2105 } |
2106 | 2106 |
2107 // Unlimited texture size. | 2107 // Unlimited texture size. |
2108 virtual void getIntegerv(WGC3Denum pname, WGC3Dint* value) | 2108 virtual void getIntegerv(WGC3Denum pname, WGC3Dint* value) |
2109 { | 2109 { |
2110 if (pname == WebCore::GraphicsContext3D::MAX_TEXTURE_SIZE) | 2110 if (pname == cc::GraphicsContext3D::MAX_TEXTURE_SIZE) |
2111 *value = 8192; | 2111 *value = 8192; |
2112 } | 2112 } |
2113 }; | 2113 }; |
2114 | 2114 |
2115 static PassOwnPtr<CCLayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, C
CLayerTreeHostImplClient* client) | 2115 static PassOwnPtr<CCLayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, C
CLayerTreeHostImplClient* client) |
2116 { | 2116 { |
2117 CCSettings::setPartialSwapEnabled(partialSwap); | 2117 CCSettings::setPartialSwapEnabled(partialSwap); |
2118 | 2118 |
2119 OwnPtr<CCGraphicsContext> context = FakeWebCompositorOutputSurface::create(a
doptPtr(new PartialSwapContext)); | 2119 OwnPtr<CCGraphicsContext> context = FakeWebCompositorOutputSurface::create(a
doptPtr(new PartialSwapContext)); |
2120 | 2120 |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2415 | 2415 |
2416 private: | 2416 private: |
2417 WebVideoFrame* m_frame; | 2417 WebVideoFrame* m_frame; |
2418 Client* m_client; | 2418 Client* m_client; |
2419 }; | 2419 }; |
2420 | 2420 |
2421 class StrictWebGraphicsContext3DWithIOSurface : public StrictWebGraphicsContext3
D { | 2421 class StrictWebGraphicsContext3DWithIOSurface : public StrictWebGraphicsContext3
D { |
2422 public: | 2422 public: |
2423 virtual WebString getString(WGC3Denum name) OVERRIDE | 2423 virtual WebString getString(WGC3Denum name) OVERRIDE |
2424 { | 2424 { |
2425 if (name == WebCore::GraphicsContext3D::EXTENSIONS) | 2425 if (name == cc::GraphicsContext3D::EXTENSIONS) |
2426 return WebString("GL_CHROMIUM_iosurface GL_ARB_texture_rectangle"); | 2426 return WebString("GL_CHROMIUM_iosurface GL_ARB_texture_rectangle"); |
2427 | 2427 |
2428 return WebString(); | 2428 return WebString(); |
2429 } | 2429 } |
2430 }; | 2430 }; |
2431 | 2431 |
2432 class FakeWebGraphicsContext3DWithIOSurface : public FakeWebGraphicsContext3D { | 2432 class FakeWebGraphicsContext3DWithIOSurface : public FakeWebGraphicsContext3D { |
2433 public: | 2433 public: |
2434 virtual WebString getString(WGC3Denum name) OVERRIDE | 2434 virtual WebString getString(WGC3Denum name) OVERRIDE |
2435 { | 2435 { |
2436 if (name == WebCore::GraphicsContext3D::EXTENSIONS) | 2436 if (name == cc::GraphicsContext3D::EXTENSIONS) |
2437 return WebString("GL_CHROMIUM_iosurface GL_ARB_texture_rectangle"); | 2437 return WebString("GL_CHROMIUM_iosurface GL_ARB_texture_rectangle"); |
2438 | 2438 |
2439 return WebString(); | 2439 return WebString(); |
2440 } | 2440 } |
2441 }; | 2441 }; |
2442 | 2442 |
2443 class FakeWebScrollbarThemeGeometryNonEmpty : public FakeWebScrollbarThemeGeomet
ry { | 2443 class FakeWebScrollbarThemeGeometryNonEmpty : public FakeWebScrollbarThemeGeomet
ry { |
2444 virtual WebRect trackRect(WebScrollbar*) OVERRIDE { return WebRect(0, 0, 10,
10); } | 2444 virtual WebRect trackRect(WebScrollbar*) OVERRIDE { return WebRect(0, 0, 10,
10); } |
2445 virtual WebRect thumbRect(WebScrollbar*) OVERRIDE { return WebRect(0, 5, 5,
2); } | 2445 virtual WebRect thumbRect(WebScrollbar*) OVERRIDE { return WebRect(0, 5, 5,
2); } |
2446 virtual void splitTrack(WebScrollbar*, const WebRect& track, WebRect& startT
rack, WebRect& thumb, WebRect& endTrack) OVERRIDE | 2446 virtual void splitTrack(WebScrollbar*, const WebRect& track, WebRect& startT
rack, WebRect& thumb, WebRect& endTrack) OVERRIDE |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2616 { | 2616 { |
2617 if (!m_textures.get(id)) | 2617 if (!m_textures.get(id)) |
2618 return; | 2618 return; |
2619 | 2619 |
2620 m_textures.set(id, false); | 2620 m_textures.set(id, false); |
2621 --m_numTextures; | 2621 --m_numTextures; |
2622 } | 2622 } |
2623 | 2623 |
2624 virtual WebString getString(WGC3Denum name) OVERRIDE | 2624 virtual WebString getString(WGC3Denum name) OVERRIDE |
2625 { | 2625 { |
2626 if (name == WebCore::GraphicsContext3D::EXTENSIONS) | 2626 if (name == cc::GraphicsContext3D::EXTENSIONS) |
2627 return WebString("GL_CHROMIUM_iosurface GL_ARB_texture_rectangle"); | 2627 return WebString("GL_CHROMIUM_iosurface GL_ARB_texture_rectangle"); |
2628 | 2628 |
2629 return WebString(); | 2629 return WebString(); |
2630 } | 2630 } |
2631 | 2631 |
2632 unsigned numTextures() const { return m_numTextures; } | 2632 unsigned numTextures() const { return m_numTextures; } |
2633 | 2633 |
2634 private: | 2634 private: |
2635 HashMap<WebGLId, bool> m_textures; | 2635 HashMap<WebGLId, bool> m_textures; |
2636 unsigned m_numTextures; | 2636 unsigned m_numTextures; |
(...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4191 while (removeRenderPassesCases[testCaseIndex].name) { | 4191 while (removeRenderPassesCases[testCaseIndex].name) { |
4192 RenderPassRemovalTestData testData; | 4192 RenderPassRemovalTestData testData; |
4193 configureRenderPassTestData(removeRenderPassesCases[testCaseIndex].initS
cript, testData, renderer.get()); | 4193 configureRenderPassTestData(removeRenderPassesCases[testCaseIndex].initS
cript, testData, renderer.get()); |
4194 CCLayerTreeHostImpl::removeRenderPasses(CCLayerTreeHostImpl::CullRenderP
assesWithCachedTextures(*renderer), testData); | 4194 CCLayerTreeHostImpl::removeRenderPasses(CCLayerTreeHostImpl::CullRenderP
assesWithCachedTextures(*renderer), testData); |
4195 verifyRenderPassTestData(removeRenderPassesCases[testCaseIndex], testDat
a); | 4195 verifyRenderPassTestData(removeRenderPassesCases[testCaseIndex], testDat
a); |
4196 testCaseIndex++; | 4196 testCaseIndex++; |
4197 } | 4197 } |
4198 } | 4198 } |
4199 | 4199 |
4200 } // namespace | 4200 } // namespace |
OLD | NEW |