| 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 "CCLayerTreeHost.h" | 7 #include "CCLayerTreeHost.h" |
| 8 | 8 |
| 9 #include "CCGeometryTestUtils.h" | 9 #include "CCGeometryTestUtils.h" |
| 10 #include "CCGraphicsContext.h" | 10 #include "CCGraphicsContext.h" |
| 11 #include "CCLayerTreeHostImpl.h" | 11 #include "CCLayerTreeHostImpl.h" |
| 12 #include "CCOcclusionTrackerTestCommon.h" | 12 #include "CCOcclusionTrackerTestCommon.h" |
| 13 #include "CCSettings.h" | 13 #include "CCSettings.h" |
| 14 #include "CCSingleThreadProxy.h" | 14 #include "CCSingleThreadProxy.h" |
| 15 #include "CCTextureUpdateQueue.h" | 15 #include "CCTextureUpdateQueue.h" |
| 16 #include "CCThreadedTest.h" | 16 #include "CCThreadedTest.h" |
| 17 #include "CCTimingFunction.h" | 17 #include "CCTimingFunction.h" |
| 18 #include "ContentLayerChromium.h" | 18 #include "ContentLayerChromium.h" |
| 19 #include "ContentLayerChromiumClient.h" | 19 #include "ContentLayerChromiumClient.h" |
| 20 #include "Extensions3DChromium.h" | 20 #include "Extensions3DChromium.h" |
| 21 #include "FakeWebCompositorOutputSurface.h" | 21 #include "FakeWebCompositorOutputSurface.h" |
| 22 #include <gmock/gmock.h> | 22 #include <gmock/gmock.h> |
| 23 #include <public/Platform.h> | 23 #include <public/Platform.h> |
| 24 #include <public/WebLayerScrollClient.h> | 24 #include <public/WebLayerScrollClient.h> |
| 25 #include <public/WebSize.h> | 25 #include <public/WebSize.h> |
| 26 #include <wtf/OwnArrayPtr.h> | 26 #include <wtf/OwnArrayPtr.h> |
| 27 | 27 |
| 28 using namespace WebCore; | 28 using namespace cc; |
| 29 using namespace WebKit; | 29 using namespace WebKit; |
| 30 using namespace WebKitTests; | 30 using namespace WebKitTests; |
| 31 | 31 |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| 34 class CCLayerTreeHostTest : public CCThreadedTest { }; | 34 class CCLayerTreeHostTest : public CCThreadedTest { }; |
| 35 | 35 |
| 36 // Shortlived layerTreeHosts shouldn't die. | 36 // Shortlived layerTreeHosts shouldn't die. |
| 37 class CCLayerTreeHostTestShortlived1 : public CCLayerTreeHostTest { | 37 class CCLayerTreeHostTestShortlived1 : public CCLayerTreeHostTest { |
| 38 public: | 38 public: |
| (...skipping 2396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2435 bool updated() const { return m_texture.get() ? m_texture->updated() : false
; } | 2435 bool updated() const { return m_texture.get() ? m_texture->updated() : false
; } |
| 2436 | 2436 |
| 2437 private: | 2437 private: |
| 2438 EvictionTestLayer() : LayerChromium() { } | 2438 EvictionTestLayer() : LayerChromium() { } |
| 2439 | 2439 |
| 2440 void createTextureIfNeeded() | 2440 void createTextureIfNeeded() |
| 2441 { | 2441 { |
| 2442 if (m_texture.get()) | 2442 if (m_texture.get()) |
| 2443 return; | 2443 return; |
| 2444 m_texture = EvictionTrackingTexture::create(CCPrioritizedTexture::create
(layerTreeHost()->contentsTextureManager())); | 2444 m_texture = EvictionTrackingTexture::create(CCPrioritizedTexture::create
(layerTreeHost()->contentsTextureManager())); |
| 2445 m_texture->texture()->setDimensions(WebCore::IntSize(10, 10), WebCore::G
raphicsContext3D::RGBA); | 2445 m_texture->texture()->setDimensions(IntSize(10, 10), cc::GraphicsContext
3D::RGBA); |
| 2446 } | 2446 } |
| 2447 | 2447 |
| 2448 OwnPtr<EvictionTrackingTexture> m_texture; | 2448 OwnPtr<EvictionTrackingTexture> m_texture; |
| 2449 }; | 2449 }; |
| 2450 | 2450 |
| 2451 class EvictionTestLayerImpl : public CCLayerImpl { | 2451 class EvictionTestLayerImpl : public CCLayerImpl { |
| 2452 public: | 2452 public: |
| 2453 static PassOwnPtr<EvictionTestLayerImpl> create(int id) | 2453 static PassOwnPtr<EvictionTestLayerImpl> create(int id) |
| 2454 { | 2454 { |
| 2455 return adoptPtr(new EvictionTestLayerImpl(id)); | 2455 return adoptPtr(new EvictionTestLayerImpl(id)); |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2988 int m_numCommitComplete; | 2988 int m_numCommitComplete; |
| 2989 int m_numDrawLayers; | 2989 int m_numDrawLayers; |
| 2990 }; | 2990 }; |
| 2991 | 2991 |
| 2992 TEST_F(CCLayerTreeHostTestContinuousAnimate, runMultiThread) | 2992 TEST_F(CCLayerTreeHostTestContinuousAnimate, runMultiThread) |
| 2993 { | 2993 { |
| 2994 runTest(true); | 2994 runTest(true); |
| 2995 } | 2995 } |
| 2996 | 2996 |
| 2997 } // namespace | 2997 } // namespace |
| OLD | NEW |