| 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 | 6 |
| 7 #include "platform/graphics/RecordingImageBufferSurface.h" | 7 #include "platform/graphics/RecordingImageBufferSurface.h" |
| 8 | 8 |
| 9 #include "platform/graphics/GraphicsContext.h" | 9 #include "platform/graphics/GraphicsContext.h" |
| 10 #include "platform/graphics/ImageBuffer.h" | 10 #include "platform/graphics/ImageBuffer.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 EXPECT_EQ(2, m_fakeImageBufferClient->frameCount()); | 202 EXPECT_EQ(2, m_fakeImageBufferClient->frameCount()); |
| 203 m_testSurface->getPicture(); | 203 m_testSurface->getPicture(); |
| 204 EXPECT_EQ(3, m_fakeImageBufferClient->frameCount()); | 204 EXPECT_EQ(3, m_fakeImageBufferClient->frameCount()); |
| 205 expectDisplayListEnabled(true); | 205 expectDisplayListEnabled(true); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void testClearRect() | 208 void testClearRect() |
| 209 { | 209 { |
| 210 m_testSurface->initializeCurrentFrame(); | 210 m_testSurface->initializeCurrentFrame(); |
| 211 m_testSurface->getPicture(); | 211 m_testSurface->getPicture(); |
| 212 m_imageBuffer->context()->clearRect(FloatRect(FloatPoint(0, 0), FloatSiz
e(m_testSurface->size()))); | 212 SkPaint clearPaint; |
| 213 clearPaint.setXfermodeMode(SkXfermode::kClear_Mode); |
| 214 m_imageBuffer->canvas()->drawRect(SkRect::MakeWH(m_testSurface->size().w
idth(), m_testSurface->size().height()), clearPaint); |
| 213 m_fakeImageBufferClient->fakeDraw(); | 215 m_fakeImageBufferClient->fakeDraw(); |
| 214 EXPECT_EQ(1, m_fakeImageBufferClient->frameCount()); | 216 EXPECT_EQ(1, m_fakeImageBufferClient->frameCount()); |
| 215 m_testSurface->getPicture(); | 217 m_testSurface->getPicture(); |
| 216 EXPECT_EQ(2, m_fakeImageBufferClient->frameCount()); | 218 EXPECT_EQ(2, m_fakeImageBufferClient->frameCount()); |
| 217 expectDisplayListEnabled(true); | 219 expectDisplayListEnabled(true); |
| 218 } | 220 } |
| 219 | 221 |
| 220 void expectDisplayListEnabled(bool displayListEnabled) | 222 void expectDisplayListEnabled(bool displayListEnabled) |
| 221 { | 223 { |
| 222 EXPECT_EQ(displayListEnabled, (bool)m_testSurface->m_currentFrame.get())
; | 224 EXPECT_EQ(displayListEnabled, (bool)m_testSurface->m_currentFrame.get())
; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 } | 393 } |
| 392 | 394 |
| 393 DEFINE_TEST_TASK_WRAPPER_CLASS(testClearRect) | 395 DEFINE_TEST_TASK_WRAPPER_CLASS(testClearRect) |
| 394 TEST_F(RecordingImageBufferSurfaceTest, testClearRect) | 396 TEST_F(RecordingImageBufferSurfaceTest, testClearRect) |
| 395 { | 397 { |
| 396 CALL_TEST_TASK_WRAPPER(testClearRect); | 398 CALL_TEST_TASK_WRAPPER(testClearRect); |
| 397 expectDisplayListEnabled(true); | 399 expectDisplayListEnabled(true); |
| 398 } | 400 } |
| 399 | 401 |
| 400 } // namespace | 402 } // namespace |
| OLD | NEW |