| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "platform/graphics/RecordingImageBufferSurface.h" | 5 #include "platform/graphics/RecordingImageBufferSurface.h" |
| 6 | 6 |
| 7 #include "platform/WebTaskRunner.h" | 7 #include "platform/WebTaskRunner.h" |
| 8 #include "platform/graphics/GraphicsContext.h" | 8 #include "platform/graphics/GraphicsContext.h" |
| 9 #include "platform/graphics/ImageBuffer.h" | 9 #include "platform/graphics/ImageBuffer.h" |
| 10 #include "platform/graphics/ImageBufferClient.h" | 10 #include "platform/graphics/ImageBufferClient.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 int createSurfaceCount() { return m_createSurfaceCount; } | 90 int createSurfaceCount() { return m_createSurfaceCount; } |
| 91 | 91 |
| 92 private: | 92 private: |
| 93 int m_createSurfaceCount; | 93 int m_createSurfaceCount; |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 class RecordingImageBufferSurfaceTest : public Test { | 96 class RecordingImageBufferSurfaceTest : public Test { |
| 97 protected: | 97 protected: |
| 98 RecordingImageBufferSurfaceTest() { | 98 RecordingImageBufferSurfaceTest() { |
| 99 std::unique_ptr<MockSurfaceFactory> surfaceFactory = | 99 std::unique_ptr<MockSurfaceFactory> surfaceFactory = |
| 100 wrapUnique(new MockSurfaceFactory()); | 100 makeUnique<MockSurfaceFactory>(); |
| 101 m_surfaceFactory = surfaceFactory.get(); | 101 m_surfaceFactory = surfaceFactory.get(); |
| 102 std::unique_ptr<RecordingImageBufferSurface> testSurface = | 102 std::unique_ptr<RecordingImageBufferSurface> testSurface = |
| 103 wrapUnique(new RecordingImageBufferSurface( | 103 wrapUnique(new RecordingImageBufferSurface( |
| 104 IntSize(10, 10), std::move(surfaceFactory), NonOpaque, nullptr)); | 104 IntSize(10, 10), std::move(surfaceFactory), NonOpaque, nullptr)); |
| 105 m_testSurface = testSurface.get(); | 105 m_testSurface = testSurface.get(); |
| 106 // We create an ImageBuffer in order for the testSurface to be | 106 // We create an ImageBuffer in order for the testSurface to be |
| 107 // properly initialized with a GraphicsContext | 107 // properly initialized with a GraphicsContext |
| 108 m_imageBuffer = ImageBuffer::create(std::move(testSurface)); | 108 m_imageBuffer = ImageBuffer::create(std::move(testSurface)); |
| 109 EXPECT_FALSE(!m_imageBuffer); | 109 EXPECT_FALSE(!m_imageBuffer); |
| 110 m_fakeImageBufferClient = | 110 m_fakeImageBufferClient = |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 CALL_TEST_TASK_WRAPPER(testAnimatedWithClear) | 270 CALL_TEST_TASK_WRAPPER(testAnimatedWithClear) |
| 271 expectDisplayListEnabled(true); | 271 expectDisplayListEnabled(true); |
| 272 } | 272 } |
| 273 | 273 |
| 274 TEST_F(RecordingImageBufferSurfaceTest, testClearRect) { | 274 TEST_F(RecordingImageBufferSurfaceTest, testClearRect) { |
| 275 CALL_TEST_TASK_WRAPPER(testClearRect); | 275 CALL_TEST_TASK_WRAPPER(testClearRect); |
| 276 expectDisplayListEnabled(true); | 276 expectDisplayListEnabled(true); |
| 277 } | 277 } |
| 278 | 278 |
| 279 } // namespace blink | 279 } // namespace blink |
| OLD | NEW |