| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 GL_STENCIL_ATTACHMENT}; | 349 GL_STENCIL_ATTACHMENT}; |
| 350 m_stateRestorer->setFramebufferBindingDirty(); | 350 m_stateRestorer->setFramebufferBindingDirty(); |
| 351 m_gl->BindFramebuffer(GL_FRAMEBUFFER, m_fbo); | 351 m_gl->BindFramebuffer(GL_FRAMEBUFFER, m_fbo); |
| 352 m_gl->DiscardFramebufferEXT(GL_FRAMEBUFFER, 3, attachments); | 352 m_gl->DiscardFramebufferEXT(GL_FRAMEBUFFER, 3, attachments); |
| 353 } | 353 } |
| 354 } else { | 354 } else { |
| 355 // If we can't discard the backbuffer, create (or recycle) a buffer to put | 355 // If we can't discard the backbuffer, create (or recycle) a buffer to put |
| 356 // in the mailbox, and copy backbuffer's contents there. | 356 // in the mailbox, and copy backbuffer's contents there. |
| 357 colorBufferForMailbox = createOrRecycleColorBuffer(); | 357 colorBufferForMailbox = createOrRecycleColorBuffer(); |
| 358 m_gl->CopySubTextureCHROMIUM( | 358 m_gl->CopySubTextureCHROMIUM( |
| 359 m_backColorBuffer->textureId, colorBufferForMailbox->textureId, 0, 0, 0, | 359 m_backColorBuffer->textureId, 0, colorBufferForMailbox->textureId, 0, 0, |
| 360 0, m_size.width(), m_size.height(), GL_FALSE, GL_FALSE, GL_FALSE); | 360 0, 0, 0, m_size.width(), m_size.height(), GL_FALSE, GL_FALSE, GL_FALSE); |
| 361 } | 361 } |
| 362 | 362 |
| 363 // Put colorBufferForMailbox into its mailbox, and populate its | 363 // Put colorBufferForMailbox into its mailbox, and populate its |
| 364 // produceSyncToken with that point. | 364 // produceSyncToken with that point. |
| 365 { | 365 { |
| 366 m_gl->ProduceTextureDirectCHROMIUM(colorBufferForMailbox->textureId, | 366 m_gl->ProduceTextureDirectCHROMIUM(colorBufferForMailbox->textureId, |
| 367 colorBufferForMailbox->parameters.target, | 367 colorBufferForMailbox->parameters.target, |
| 368 colorBufferForMailbox->mailbox.name); | 368 colorBufferForMailbox->mailbox.name); |
| 369 const GLuint64 fenceSync = m_gl->InsertFenceSyncCHROMIUM(); | 369 const GLuint64 fenceSync = m_gl->InsertFenceSyncCHROMIUM(); |
| 370 #if OS(MACOSX) | 370 #if OS(MACOSX) |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 gl->CreateAndConsumeTextureCHROMIUM(target, mailbox.name); | 723 gl->CreateAndConsumeTextureCHROMIUM(target, mailbox.name); |
| 724 | 724 |
| 725 GLboolean unpackPremultiplyAlphaNeeded = GL_FALSE; | 725 GLboolean unpackPremultiplyAlphaNeeded = GL_FALSE; |
| 726 GLboolean unpackUnpremultiplyAlphaNeeded = GL_FALSE; | 726 GLboolean unpackUnpremultiplyAlphaNeeded = GL_FALSE; |
| 727 if (m_wantAlphaChannel && m_premultipliedAlpha && !premultiplyAlpha) | 727 if (m_wantAlphaChannel && m_premultipliedAlpha && !premultiplyAlpha) |
| 728 unpackUnpremultiplyAlphaNeeded = GL_TRUE; | 728 unpackUnpremultiplyAlphaNeeded = GL_TRUE; |
| 729 else if (m_wantAlphaChannel && !m_premultipliedAlpha && premultiplyAlpha) | 729 else if (m_wantAlphaChannel && !m_premultipliedAlpha && premultiplyAlpha) |
| 730 unpackPremultiplyAlphaNeeded = GL_TRUE; | 730 unpackPremultiplyAlphaNeeded = GL_TRUE; |
| 731 | 731 |
| 732 gl->CopySubTextureCHROMIUM( | 732 gl->CopySubTextureCHROMIUM( |
| 733 sourceTexture, texture, destTextureOffset.x(), destTextureOffset.y(), | 733 sourceTexture, 0, texture, 0, destTextureOffset.x(), |
| 734 sourceSubRectangle.x(), sourceSubRectangle.y(), | 734 destTextureOffset.y(), sourceSubRectangle.x(), sourceSubRectangle.y(), |
| 735 sourceSubRectangle.width(), sourceSubRectangle.height(), flipY, | 735 sourceSubRectangle.width(), sourceSubRectangle.height(), flipY, |
| 736 unpackPremultiplyAlphaNeeded, unpackUnpremultiplyAlphaNeeded); | 736 unpackPremultiplyAlphaNeeded, unpackUnpremultiplyAlphaNeeded); |
| 737 | 737 |
| 738 gl->DeleteTextures(1, &sourceTexture); | 738 gl->DeleteTextures(1, &sourceTexture); |
| 739 | 739 |
| 740 const GLuint64 fenceSync = gl->InsertFenceSyncCHROMIUM(); | 740 const GLuint64 fenceSync = gl->InsertFenceSyncCHROMIUM(); |
| 741 | 741 |
| 742 gl->Flush(); | 742 gl->Flush(); |
| 743 gpu::SyncToken syncToken; | 743 gpu::SyncToken syncToken; |
| 744 gl->GenSyncTokenCHROMIUM(fenceSync, syncToken.GetData()); | 744 gl->GenSyncTokenCHROMIUM(fenceSync, syncToken.GetData()); |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1266 if (m_pixelUnpackBufferBindingDirty) | 1266 if (m_pixelUnpackBufferBindingDirty) |
| 1267 client->DrawingBufferClientRestorePixelUnpackBufferBinding(); | 1267 client->DrawingBufferClientRestorePixelUnpackBufferBinding(); |
| 1268 } | 1268 } |
| 1269 | 1269 |
| 1270 bool DrawingBuffer::shouldUseChromiumImage() { | 1270 bool DrawingBuffer::shouldUseChromiumImage() { |
| 1271 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && | 1271 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && |
| 1272 m_chromiumImageUsage == AllowChromiumImage; | 1272 m_chromiumImageUsage == AllowChromiumImage; |
| 1273 } | 1273 } |
| 1274 | 1274 |
| 1275 } // namespace blink | 1275 } // namespace blink |
| OLD | NEW |