| 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, 0, colorBufferForMailbox->textureId, 0, 0, | 359 colorBufferForMailbox->parameters.target, m_backColorBuffer->textureId, |
| 360 0, 0, 0, m_size.width(), m_size.height(), GL_FALSE, GL_FALSE, GL_FALSE); | 360 0, colorBufferForMailbox->textureId, 0, 0, 0, 0, 0, m_size.width(), |
| 361 m_size.height(), GL_FALSE, GL_FALSE, GL_FALSE); |
| 361 } | 362 } |
| 362 | 363 |
| 363 // Put colorBufferForMailbox into its mailbox, and populate its | 364 // Put colorBufferForMailbox into its mailbox, and populate its |
| 364 // produceSyncToken with that point. | 365 // produceSyncToken with that point. |
| 365 { | 366 { |
| 366 m_gl->ProduceTextureDirectCHROMIUM(colorBufferForMailbox->textureId, | 367 m_gl->ProduceTextureDirectCHROMIUM(colorBufferForMailbox->textureId, |
| 367 colorBufferForMailbox->parameters.target, | 368 colorBufferForMailbox->parameters.target, |
| 368 colorBufferForMailbox->mailbox.name); | 369 colorBufferForMailbox->mailbox.name); |
| 369 const GLuint64 fenceSync = m_gl->InsertFenceSyncCHROMIUM(); | 370 const GLuint64 fenceSync = m_gl->InsertFenceSyncCHROMIUM(); |
| 370 #if OS(MACOSX) | 371 #if OS(MACOSX) |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 gl->CreateAndConsumeTextureCHROMIUM(target, mailbox.name); | 724 gl->CreateAndConsumeTextureCHROMIUM(target, mailbox.name); |
| 724 | 725 |
| 725 GLboolean unpackPremultiplyAlphaNeeded = GL_FALSE; | 726 GLboolean unpackPremultiplyAlphaNeeded = GL_FALSE; |
| 726 GLboolean unpackUnpremultiplyAlphaNeeded = GL_FALSE; | 727 GLboolean unpackUnpremultiplyAlphaNeeded = GL_FALSE; |
| 727 if (m_wantAlphaChannel && m_premultipliedAlpha && !premultiplyAlpha) | 728 if (m_wantAlphaChannel && m_premultipliedAlpha && !premultiplyAlpha) |
| 728 unpackUnpremultiplyAlphaNeeded = GL_TRUE; | 729 unpackUnpremultiplyAlphaNeeded = GL_TRUE; |
| 729 else if (m_wantAlphaChannel && !m_premultipliedAlpha && premultiplyAlpha) | 730 else if (m_wantAlphaChannel && !m_premultipliedAlpha && premultiplyAlpha) |
| 730 unpackPremultiplyAlphaNeeded = GL_TRUE; | 731 unpackPremultiplyAlphaNeeded = GL_TRUE; |
| 731 | 732 |
| 732 gl->CopySubTextureCHROMIUM( | 733 gl->CopySubTextureCHROMIUM( |
| 733 sourceTexture, 0, texture, 0, destTextureOffset.x(), | 734 GL_TEXTURE_2D, sourceTexture, 0, texture, 0, destTextureOffset.x(), |
| 734 destTextureOffset.y(), sourceSubRectangle.x(), sourceSubRectangle.y(), | 735 destTextureOffset.y(), sourceSubRectangle.x(), sourceSubRectangle.y(), |
| 735 sourceSubRectangle.width(), sourceSubRectangle.height(), flipY, | 736 sourceSubRectangle.width(), sourceSubRectangle.height(), flipY, |
| 736 unpackPremultiplyAlphaNeeded, unpackUnpremultiplyAlphaNeeded); | 737 unpackPremultiplyAlphaNeeded, unpackUnpremultiplyAlphaNeeded); |
| 737 | 738 |
| 738 gl->DeleteTextures(1, &sourceTexture); | 739 gl->DeleteTextures(1, &sourceTexture); |
| 739 | 740 |
| 740 const GLuint64 fenceSync = gl->InsertFenceSyncCHROMIUM(); | 741 const GLuint64 fenceSync = gl->InsertFenceSyncCHROMIUM(); |
| 741 | 742 |
| 742 gl->Flush(); | 743 gl->Flush(); |
| 743 gpu::SyncToken syncToken; | 744 gpu::SyncToken syncToken; |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1266 if (m_pixelUnpackBufferBindingDirty) | 1267 if (m_pixelUnpackBufferBindingDirty) |
| 1267 client->DrawingBufferClientRestorePixelUnpackBufferBinding(); | 1268 client->DrawingBufferClientRestorePixelUnpackBufferBinding(); |
| 1268 } | 1269 } |
| 1269 | 1270 |
| 1270 bool DrawingBuffer::shouldUseChromiumImage() { | 1271 bool DrawingBuffer::shouldUseChromiumImage() { |
| 1271 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && | 1272 return RuntimeEnabledFeatures::webGLImageChromiumEnabled() && |
| 1272 m_chromiumImageUsage == AllowChromiumImage; | 1273 m_chromiumImageUsage == AllowChromiumImage; |
| 1273 } | 1274 } |
| 1274 | 1275 |
| 1275 } // namespace blink | 1276 } // namespace blink |
| OLD | NEW |