| 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(conte
xtProvider->contextGL()); | 238 OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(conte
xtProvider->contextGL()); |
| 239 RefPtr<DrawingBufferForTests> drawingBuffer = adoptRef(new DrawingBuffer
ForTests(contextProvider, extensionsUtil.release(), preserve)); | 239 RefPtr<DrawingBufferForTests> drawingBuffer = adoptRef(new DrawingBuffer
ForTests(contextProvider, extensionsUtil.release(), preserve)); |
| 240 if (!drawingBuffer->initialize(size)) { | 240 if (!drawingBuffer->initialize(size)) { |
| 241 drawingBuffer->beginDestruction(); | 241 drawingBuffer->beginDestruction(); |
| 242 return PassRefPtr<DrawingBufferForTests>(); | 242 return PassRefPtr<DrawingBufferForTests>(); |
| 243 } | 243 } |
| 244 return drawingBuffer.release(); | 244 return drawingBuffer.release(); |
| 245 } | 245 } |
| 246 | 246 |
| 247 DrawingBufferForTests(PassOwnPtr<WebGraphicsContext3DProvider> contextProvid
er, PassOwnPtr<Extensions3DUtil> extensionsUtil, PreserveDrawingBuffer preserve) | 247 DrawingBufferForTests(PassOwnPtr<WebGraphicsContext3DProvider> contextProvid
er, PassOwnPtr<Extensions3DUtil> extensionsUtil, PreserveDrawingBuffer preserve) |
| 248 : DrawingBuffer(contextProvider, extensionsUtil, false /* multisampleExt
ensionSupported */, false /* discardFramebufferSupported */, preserve, WebGraphi
csContext3D::Attributes()) | 248 : DrawingBuffer(contextProvider, extensionsUtil, false /* multisampleExt
ensionSupported */, false /* discardFramebufferSupported */, false /* premultipl
iedAlpha */, preserve, WebGraphicsContext3D::Attributes()) |
| 249 , m_live(0) | 249 , m_live(0) |
| 250 { } | 250 { } |
| 251 | 251 |
| 252 ~DrawingBufferForTests() override | 252 ~DrawingBufferForTests() override |
| 253 { | 253 { |
| 254 if (m_live) | 254 if (m_live) |
| 255 *m_live = false; | 255 *m_live = false; |
| 256 } | 256 } |
| 257 | 257 |
| 258 bool* m_live; | 258 bool* m_live; |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 OwnPtr<DepthStencilTrackingGLES2Interface> gl = adoptPtr(new DepthStenci
lTrackingGLES2Interface); | 717 OwnPtr<DepthStencilTrackingGLES2Interface> gl = adoptPtr(new DepthStenci
lTrackingGLES2Interface); |
| 718 DepthStencilTrackingGLES2Interface* trackingGL = gl.get(); | 718 DepthStencilTrackingGLES2Interface* trackingGL = gl.get(); |
| 719 OwnPtr<DepthStencilTrackingContext> context = adoptPtr(new DepthStencilT
rackingContext(trackingGL)); | 719 OwnPtr<DepthStencilTrackingContext> context = adoptPtr(new DepthStencilT
rackingContext(trackingGL)); |
| 720 DepthStencilTrackingContext* trackingContext = context.get(); | 720 DepthStencilTrackingContext* trackingContext = context.get(); |
| 721 OwnPtr<WebGraphicsContext3DProviderForTests> provider = adoptPtr(new Web
GraphicsContext3DProviderForTests(context.release(), gl.release())); | 721 OwnPtr<WebGraphicsContext3DProviderForTests> provider = adoptPtr(new Web
GraphicsContext3DProviderForTests(context.release(), gl.release())); |
| 722 DrawingBuffer::PreserveDrawingBuffer preserve = DrawingBuffer::Preserve; | 722 DrawingBuffer::PreserveDrawingBuffer preserve = DrawingBuffer::Preserve; |
| 723 | 723 |
| 724 WebGraphicsContext3D::Attributes requestedAttributes; | 724 WebGraphicsContext3D::Attributes requestedAttributes; |
| 725 requestedAttributes.stencil = cases[i].requestStencil; | 725 requestedAttributes.stencil = cases[i].requestStencil; |
| 726 requestedAttributes.depth = cases[i].requestDepth; | 726 requestedAttributes.depth = cases[i].requestDepth; |
| 727 RefPtr<DrawingBuffer> drawingBuffer = DrawingBuffer::create(provider.rel
ease(), IntSize(10, 10), preserve, requestedAttributes); | 727 RefPtr<DrawingBuffer> drawingBuffer = DrawingBuffer::create(provider.rel
ease(), IntSize(10, 10), false /* premultipliedAlpha */, preserve, requestedAttr
ibutes); |
| 728 | 728 |
| 729 EXPECT_EQ(cases[i].requestDepth, drawingBuffer->getActualAttributes().de
pth); | 729 EXPECT_EQ(cases[i].requestDepth, drawingBuffer->getActualAttributes().de
pth); |
| 730 EXPECT_EQ(cases[i].requestStencil, drawingBuffer->getActualAttributes().
stencil); | 730 EXPECT_EQ(cases[i].requestStencil, drawingBuffer->getActualAttributes().
stencil); |
| 731 EXPECT_EQ(cases[i].expectedRenderBuffers, trackingContext->numAllocatedR
enderBuffer()); | 731 EXPECT_EQ(cases[i].expectedRenderBuffers, trackingContext->numAllocatedR
enderBuffer()); |
| 732 if (cases[i].requestDepth || cases[i].requestStencil) { | 732 if (cases[i].requestDepth || cases[i].requestStencil) { |
| 733 EXPECT_NE(0u, trackingContext->depthStencilAttachment()); | 733 EXPECT_NE(0u, trackingContext->depthStencilAttachment()); |
| 734 EXPECT_EQ(0u, trackingContext->depthAttachment()); | 734 EXPECT_EQ(0u, trackingContext->depthAttachment()); |
| 735 EXPECT_EQ(0u, trackingContext->stencilAttachment()); | 735 EXPECT_EQ(0u, trackingContext->stencilAttachment()); |
| 736 } else { | 736 } else { |
| 737 EXPECT_EQ(0u, trackingContext->depthStencilAttachment()); | 737 EXPECT_EQ(0u, trackingContext->depthStencilAttachment()); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 m_drawingBuffer->markContentsChanged(); | 807 m_drawingBuffer->markContentsChanged(); |
| 808 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); | 808 EXPECT_TRUE(m_drawingBuffer->prepareMailbox(&mailbox, 0)); |
| 809 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); | 809 EXPECT_EQ(initialSize, webContext()->mostRecentlyProducedSize()); |
| 810 EXPECT_FALSE(mailbox.allowOverlay); | 810 EXPECT_FALSE(mailbox.allowOverlay); |
| 811 | 811 |
| 812 m_drawingBuffer->mailboxReleased(mailbox, false); | 812 m_drawingBuffer->mailboxReleased(mailbox, false); |
| 813 m_drawingBuffer->beginDestruction(); | 813 m_drawingBuffer->beginDestruction(); |
| 814 } | 814 } |
| 815 | 815 |
| 816 } // namespace blink | 816 } // namespace blink |
| OLD | NEW |