| 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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 context->waitSyncPoint(mailbox.syncPoint); | 503 context->waitSyncPoint(mailbox.syncPoint); |
| 504 Platform3DObject sourceTexture = context->createAndConsumeTextureCHROMIUM(GL
_TEXTURE_2D, mailbox.name); | 504 Platform3DObject sourceTexture = context->createAndConsumeTextureCHROMIUM(GL
_TEXTURE_2D, mailbox.name); |
| 505 | 505 |
| 506 GLboolean unpackPremultiplyAlphaNeeded = GL_FALSE; | 506 GLboolean unpackPremultiplyAlphaNeeded = GL_FALSE; |
| 507 GLboolean unpackUnpremultiplyAlphaNeeded = GL_FALSE; | 507 GLboolean unpackUnpremultiplyAlphaNeeded = GL_FALSE; |
| 508 if (m_actualAttributes.alpha && m_actualAttributes.premultipliedAlpha && !pr
emultiplyAlpha) | 508 if (m_actualAttributes.alpha && m_actualAttributes.premultipliedAlpha && !pr
emultiplyAlpha) |
| 509 unpackUnpremultiplyAlphaNeeded = GL_TRUE; | 509 unpackUnpremultiplyAlphaNeeded = GL_TRUE; |
| 510 else if (m_actualAttributes.alpha && !m_actualAttributes.premultipliedAlpha
&& premultiplyAlpha) | 510 else if (m_actualAttributes.alpha && !m_actualAttributes.premultipliedAlpha
&& premultiplyAlpha) |
| 511 unpackPremultiplyAlphaNeeded = GL_TRUE; | 511 unpackPremultiplyAlphaNeeded = GL_TRUE; |
| 512 | 512 |
| 513 context->pixelStorei(GC3D_UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM, unpackUnpremu
ltiplyAlphaNeeded); | |
| 514 context->pixelStorei(GC3D_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM, unpackPremultip
lyAlphaNeeded); | |
| 515 context->pixelStorei(GC3D_UNPACK_FLIP_Y_CHROMIUM, flipY); | |
| 516 context->copyTextureCHROMIUM(GL_TEXTURE_2D, sourceTexture, texture, internal
Format, destType, flipY, unpackPremultiplyAlphaNeeded, unpackUnpremultiplyAlphaN
eeded); | 513 context->copyTextureCHROMIUM(GL_TEXTURE_2D, sourceTexture, texture, internal
Format, destType, flipY, unpackPremultiplyAlphaNeeded, unpackUnpremultiplyAlphaN
eeded); |
| 517 context->pixelStorei(GC3D_UNPACK_FLIP_Y_CHROMIUM, GL_FALSE); | |
| 518 context->pixelStorei(GC3D_UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM, GL_FALSE); | |
| 519 context->pixelStorei(GC3D_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM, GL_FALSE); | |
| 520 | 514 |
| 521 context->deleteTexture(sourceTexture); | 515 context->deleteTexture(sourceTexture); |
| 522 | 516 |
| 523 context->flush(); | 517 context->flush(); |
| 524 m_context->waitSyncPoint(context->insertSyncPoint()); | 518 m_context->waitSyncPoint(context->insertSyncPoint()); |
| 525 | 519 |
| 526 return true; | 520 return true; |
| 527 } | 521 } |
| 528 | 522 |
| 529 Platform3DObject DrawingBuffer::framebuffer() const | 523 Platform3DObject DrawingBuffer::framebuffer() const |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 void DrawingBuffer::deleteChromiumImageForTexture(TextureInfo* info) | 1007 void DrawingBuffer::deleteChromiumImageForTexture(TextureInfo* info) |
| 1014 { | 1008 { |
| 1015 if (info->imageId) { | 1009 if (info->imageId) { |
| 1016 m_context->releaseTexImage2DCHROMIUM(GL_TEXTURE_2D, info->imageId); | 1010 m_context->releaseTexImage2DCHROMIUM(GL_TEXTURE_2D, info->imageId); |
| 1017 m_context->destroyImageCHROMIUM(info->imageId); | 1011 m_context->destroyImageCHROMIUM(info->imageId); |
| 1018 info->imageId = 0; | 1012 info->imageId = 0; |
| 1019 } | 1013 } |
| 1020 } | 1014 } |
| 1021 | 1015 |
| 1022 } // namespace blink | 1016 } // namespace blink |
| OLD | NEW |