| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 209 |
| 210 WebGraphicsContext3DForTests* webContext() | 210 WebGraphicsContext3DForTests* webContext() |
| 211 { | 211 { |
| 212 return m_context; | 212 return m_context; |
| 213 } | 213 } |
| 214 | 214 |
| 215 WebGraphicsContext3DForTests* m_context; | 215 WebGraphicsContext3DForTests* m_context; |
| 216 RefPtr<DrawingBufferForTests> m_drawingBuffer; | 216 RefPtr<DrawingBufferForTests> m_drawingBuffer; |
| 217 }; | 217 }; |
| 218 | 218 |
| 219 TEST_F(DrawingBufferTest, testPaintRenderingResultsToCanvas) | |
| 220 { | |
| 221 OwnPtr<ImageBufferSurface> imageBufferSurface = adoptPtr(new UnacceleratedIm
ageBufferSurface(IntSize(initialWidth, initialHeight))); | |
| 222 EXPECT_FALSE(!imageBufferSurface); | |
| 223 EXPECT_TRUE(imageBufferSurface->isValid()); | |
| 224 OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(imageBufferSurface.rel
ease()); | |
| 225 EXPECT_FALSE(!imageBuffer); | |
| 226 EXPECT_FALSE(imageBuffer->isAccelerated()); | |
| 227 EXPECT_FALSE(!imageBuffer->newImageSnapshot()); | |
| 228 m_drawingBuffer->paintRenderingResultsToCanvas(imageBuffer.get()); | |
| 229 EXPECT_FALSE(imageBuffer->isAccelerated()); | |
| 230 EXPECT_FALSE(!imageBuffer->newImageSnapshot()); | |
| 231 m_drawingBuffer->beginDestruction(); | |
| 232 } | |
| 233 | |
| 234 TEST_F(DrawingBufferTest, verifyResizingProperlyAffectsMailboxes) | 219 TEST_F(DrawingBufferTest, verifyResizingProperlyAffectsMailboxes) |
| 235 { | 220 { |
| 236 WebExternalTextureMailbox mailbox; | 221 WebExternalTextureMailbox mailbox; |
| 237 | 222 |
| 238 IntSize initialSize(initialWidth, initialHeight); | 223 IntSize initialSize(initialWidth, initialHeight); |
| 239 IntSize alternateSize(initialWidth, alternateHeight); | 224 IntSize alternateSize(initialWidth, alternateHeight); |
| 240 | 225 |
| 241 // Produce one mailbox at size 100x100. | 226 // Produce one mailbox at size 100x100. |
| 242 m_drawingBuffer->markContentsChanged(); | 227 m_drawingBuffer->markContentsChanged(); |
| 243 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); | 228 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 // m_drawingBuffer deletes mailbox immediately when hidden. | 652 // m_drawingBuffer deletes mailbox immediately when hidden. |
| 668 | 653 |
| 669 WGC3Duint waitSyncToken = 0; | 654 WGC3Duint waitSyncToken = 0; |
| 670 memcpy(&waitSyncToken, mailbox.syncToken, sizeof(waitSyncToken)); | 655 memcpy(&waitSyncToken, mailbox.syncToken, sizeof(waitSyncToken)); |
| 671 EXPECT_EQ(waitSyncToken, webContext()->mostRecentlyWaitedSyncToken()); | 656 EXPECT_EQ(waitSyncToken, webContext()->mostRecentlyWaitedSyncToken()); |
| 672 | 657 |
| 673 m_drawingBuffer->beginDestruction(); | 658 m_drawingBuffer->beginDestruction(); |
| 674 } | 659 } |
| 675 | 660 |
| 676 } // namespace blink | 661 } // namespace blink |
| OLD | NEW |