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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 RefPtr<DrawingBufferForTests> drawingBuffer = adoptRef(new DrawingBuffer
ForTests(std::move(contextProvider), std::move(extensionsUtil), preserve)); | 223 RefPtr<DrawingBufferForTests> drawingBuffer = adoptRef(new DrawingBuffer
ForTests(std::move(contextProvider), std::move(extensionsUtil), preserve)); |
224 bool multisampleExtensionSupported = false; | 224 bool multisampleExtensionSupported = false; |
225 if (!drawingBuffer->initialize(size, multisampleExtensionSupported)) { | 225 if (!drawingBuffer->initialize(size, multisampleExtensionSupported)) { |
226 drawingBuffer->beginDestruction(); | 226 drawingBuffer->beginDestruction(); |
227 return nullptr; | 227 return nullptr; |
228 } | 228 } |
229 return drawingBuffer.release(); | 229 return drawingBuffer.release(); |
230 } | 230 } |
231 | 231 |
232 DrawingBufferForTests(std::unique_ptr<WebGraphicsContext3DProvider> contextP
rovider, std::unique_ptr<Extensions3DUtil> extensionsUtil, PreserveDrawingBuffer
preserve) | 232 DrawingBufferForTests(std::unique_ptr<WebGraphicsContext3DProvider> contextP
rovider, std::unique_ptr<Extensions3DUtil> extensionsUtil, PreserveDrawingBuffer
preserve) |
233 : DrawingBuffer(std::move(contextProvider), std::move(extensionsUtil), f
alse /* discardFramebufferSupported */, true /* wantAlphaChannel */, false /* pr
emultipliedAlpha */, preserve, false /* wantDepth */, false /* wantStencil */) | 233 : DrawingBuffer(std::move(contextProvider), std::move(extensionsUtil), f
alse /* discardFramebufferSupported */, |
| 234 true /* wantAlphaChannel */, false /* premultipliedAlpha */, preserv
e, WebGL1, |
| 235 false /* wantDepth */, false /* wantStencil */) |
234 , m_live(0) | 236 , m_live(0) |
235 { } | 237 { } |
236 | 238 |
237 ~DrawingBufferForTests() override | 239 ~DrawingBufferForTests() override |
238 { | 240 { |
239 if (m_live) | 241 if (m_live) |
240 *m_live = false; | 242 *m_live = false; |
241 } | 243 } |
242 | 244 |
243 bool* m_live; | 245 bool* m_live; |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 bool wantStencilBuffer = cases[i].requestStencil; | 722 bool wantStencilBuffer = cases[i].requestStencil; |
721 bool wantAntialiasing = false; | 723 bool wantAntialiasing = false; |
722 RefPtr<DrawingBuffer> drawingBuffer = DrawingBuffer::create( | 724 RefPtr<DrawingBuffer> drawingBuffer = DrawingBuffer::create( |
723 std::move(provider), | 725 std::move(provider), |
724 IntSize(10, 10), | 726 IntSize(10, 10), |
725 premultipliedAlpha, | 727 premultipliedAlpha, |
726 wantAlphaChannel, | 728 wantAlphaChannel, |
727 wantDepthBuffer, | 729 wantDepthBuffer, |
728 wantStencilBuffer, | 730 wantStencilBuffer, |
729 wantAntialiasing, | 731 wantAntialiasing, |
730 preserve); | 732 preserve, |
| 733 DrawingBuffer::WebGL1); |
731 | 734 |
732 // When we request a depth or a stencil buffer, we will get both. | 735 // When we request a depth or a stencil buffer, we will get both. |
733 EXPECT_EQ(cases[i].requestDepth || cases[i].requestStencil, drawingBuffe
r->hasDepthBuffer()); | 736 EXPECT_EQ(cases[i].requestDepth || cases[i].requestStencil, drawingBuffe
r->hasDepthBuffer()); |
734 EXPECT_EQ(cases[i].requestDepth || cases[i].requestStencil, drawingBuffe
r->hasStencilBuffer()); | 737 EXPECT_EQ(cases[i].requestDepth || cases[i].requestStencil, drawingBuffe
r->hasStencilBuffer()); |
735 EXPECT_EQ(cases[i].expectedRenderBuffers, trackingGL->numAllocatedRender
Buffer()); | 738 EXPECT_EQ(cases[i].expectedRenderBuffers, trackingGL->numAllocatedRender
Buffer()); |
736 if (cases[i].requestDepth || cases[i].requestStencil) { | 739 if (cases[i].requestDepth || cases[i].requestStencil) { |
737 EXPECT_NE(0u, trackingGL->depthStencilAttachment()); | 740 EXPECT_NE(0u, trackingGL->depthStencilAttachment()); |
738 EXPECT_EQ(0u, trackingGL->depthAttachment()); | 741 EXPECT_EQ(0u, trackingGL->depthAttachment()); |
739 EXPECT_EQ(0u, trackingGL->stencilAttachment()); | 742 EXPECT_EQ(0u, trackingGL->stencilAttachment()); |
740 } else { | 743 } else { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 // m_drawingBuffer deletes mailbox immediately when hidden. | 779 // m_drawingBuffer deletes mailbox immediately when hidden. |
777 | 780 |
778 GLuint waitSyncToken = 0; | 781 GLuint waitSyncToken = 0; |
779 memcpy(&waitSyncToken, mailbox.syncToken, sizeof(waitSyncToken)); | 782 memcpy(&waitSyncToken, mailbox.syncToken, sizeof(waitSyncToken)); |
780 EXPECT_EQ(waitSyncToken, m_gl->mostRecentlyWaitedSyncToken()); | 783 EXPECT_EQ(waitSyncToken, m_gl->mostRecentlyWaitedSyncToken()); |
781 | 784 |
782 m_drawingBuffer->beginDestruction(); | 785 m_drawingBuffer->beginDestruction(); |
783 } | 786 } |
784 | 787 |
785 } // namespace blink | 788 } // namespace blink |
OLD | NEW |