| 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 "config.h" | 5 #include "config.h" |
| 6 #include "platform/graphics/RecordingImageBufferSurface.h" | 6 #include "platform/graphics/RecordingImageBufferSurface.h" |
| 7 | 7 |
| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 EXPECT_EQ(2, m_fakeImageBufferClient->frameCount()); | 197 EXPECT_EQ(2, m_fakeImageBufferClient->frameCount()); |
| 198 m_testSurface->getPicture(); | 198 m_testSurface->getPicture(); |
| 199 EXPECT_EQ(3, m_fakeImageBufferClient->frameCount()); | 199 EXPECT_EQ(3, m_fakeImageBufferClient->frameCount()); |
| 200 expectDisplayListEnabled(true); | 200 expectDisplayListEnabled(true); |
| 201 } | 201 } |
| 202 | 202 |
| 203 void testClearRect() | 203 void testClearRect() |
| 204 { | 204 { |
| 205 m_testSurface->initializeCurrentFrame(); | 205 m_testSurface->initializeCurrentFrame(); |
| 206 m_testSurface->getPicture(); | 206 m_testSurface->getPicture(); |
| 207 m_imageBuffer->context()->clearRect(FloatRect(FloatPoint(0, 0), FloatSiz
e(m_testSurface->size()))); | 207 SkPaint clearPaint; |
| 208 clearPaint.setXfermodeMode(SkXfermode::kClear_Mode); |
| 209 m_imageBuffer->canvas()->drawRect(SkRect::MakeWH(m_testSurface->size().w
idth(), m_testSurface->size().height()), clearPaint); |
| 208 m_fakeImageBufferClient->fakeDraw(); | 210 m_fakeImageBufferClient->fakeDraw(); |
| 209 EXPECT_EQ(1, m_fakeImageBufferClient->frameCount()); | 211 EXPECT_EQ(1, m_fakeImageBufferClient->frameCount()); |
| 210 m_testSurface->getPicture(); | 212 m_testSurface->getPicture(); |
| 211 EXPECT_EQ(2, m_fakeImageBufferClient->frameCount()); | 213 EXPECT_EQ(2, m_fakeImageBufferClient->frameCount()); |
| 212 expectDisplayListEnabled(true); | 214 expectDisplayListEnabled(true); |
| 213 } | 215 } |
| 214 | 216 |
| 215 void expectDisplayListEnabled(bool displayListEnabled) | 217 void expectDisplayListEnabled(bool displayListEnabled) |
| 216 { | 218 { |
| 217 EXPECT_EQ(displayListEnabled, (bool)m_testSurface->m_currentFrame.get())
; | 219 EXPECT_EQ(displayListEnabled, (bool)m_testSurface->m_currentFrame.get())
; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 } | 389 } |
| 388 | 390 |
| 389 DEFINE_TEST_TASK_WRAPPER_CLASS(testClearRect) | 391 DEFINE_TEST_TASK_WRAPPER_CLASS(testClearRect) |
| 390 TEST_F(RecordingImageBufferSurfaceTest, testClearRect) | 392 TEST_F(RecordingImageBufferSurfaceTest, testClearRect) |
| 391 { | 393 { |
| 392 CALL_TEST_TASK_WRAPPER(testClearRect); | 394 CALL_TEST_TASK_WRAPPER(testClearRect); |
| 393 expectDisplayListEnabled(true); | 395 expectDisplayListEnabled(true); |
| 394 } | 396 } |
| 395 | 397 |
| 396 } // namespace blink | 398 } // namespace blink |
| OLD | NEW |