| 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 <memory> | 7 #include <memory> |
| 8 #include "platform/WebTaskRunner.h" | 8 #include "platform/WebTaskRunner.h" |
| 9 #include "platform/graphics/GraphicsContext.h" | 9 #include "platform/graphics/GraphicsContext.h" |
| 10 #include "platform/graphics/ImageBuffer.h" | 10 #include "platform/graphics/ImageBuffer.h" |
| 11 #include "platform/graphics/ImageBufferClient.h" | 11 #include "platform/graphics/ImageBufferClient.h" |
| 12 #include "platform/graphics/UnacceleratedImageBufferSurface.h" | 12 #include "platform/graphics/UnacceleratedImageBufferSurface.h" |
| 13 #include "platform/graphics/paint/PaintCanvas.h" | 13 #include "platform/graphics/paint/PaintCanvas.h" |
| 14 #include "platform/graphics/paint/PaintRecord.h" | 14 #include "platform/graphics/paint/PaintRecord.h" |
| 15 #include "platform/testing/TestingPlatformSupport.h" | 15 #include "platform/testing/TestingPlatformSupport.h" |
| 16 #include "platform/wtf/PtrUtil.h" | 16 #include "platform/wtf/PtrUtil.h" |
| 17 #include "platform/wtf/RefPtr.h" | 17 #include "platform/wtf/RefPtr.h" |
| 18 #include "public/platform/Platform.h" | 18 #include "public/platform/Platform.h" |
| 19 #include "public/platform/WebThread.h" | 19 #include "public/platform/WebThread.h" |
| 20 #include "public/platform/WebTraceLocation.h" | 20 #include "public/platform/WebTraceLocation.h" |
| 21 #include "testing/gmock/include/gmock/gmock.h" | 21 #include "testing/gmock/include/gmock/gmock.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 23 | 23 |
| 24 using testing::Test; | 24 using ::testing::Test; |
| 25 | 25 |
| 26 namespace blink { | 26 namespace blink { |
| 27 | 27 |
| 28 class RecordingImageBufferSurfaceTest : public Test { | 28 class RecordingImageBufferSurfaceTest : public Test { |
| 29 protected: | 29 protected: |
| 30 RecordingImageBufferSurfaceTest() { | 30 RecordingImageBufferSurfaceTest() { |
| 31 auto test_surface = WTF::MakeUnique<RecordingImageBufferSurface>( | 31 auto test_surface = WTF::MakeUnique<RecordingImageBufferSurface>( |
| 32 IntSize(10, 10), RecordingImageBufferSurface::kAllowFallback, | 32 IntSize(10, 10), RecordingImageBufferSurface::kAllowFallback, |
| 33 kNonOpaque); | 33 kNonOpaque); |
| 34 test_surface_ = test_surface.get(); | 34 test_surface_ = test_surface.get(); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 clear_flags.setBlendMode(SkBlendMode::kClear); | 96 clear_flags.setBlendMode(SkBlendMode::kClear); |
| 97 Canvas()->drawRect(SkRect::MakeWH(TestSurface()->size().Width(), | 97 Canvas()->drawRect(SkRect::MakeWH(TestSurface()->size().Width(), |
| 98 TestSurface()->size().Height()), | 98 TestSurface()->size().Height()), |
| 99 clear_flags); | 99 clear_flags); |
| 100 TestSurface()->DidDraw(FloatRect(0, 0, 1, 1)); | 100 TestSurface()->DidDraw(FloatRect(0, 0, 1, 1)); |
| 101 TestSurface()->GetRecord(); | 101 TestSurface()->GetRecord(); |
| 102 EXPECT_TRUE(TestSurface()->IsRecording()); | 102 EXPECT_TRUE(TestSurface()->IsRecording()); |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace blink | 105 } // namespace blink |
| OLD | NEW |