| 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 12 matching lines...) Expand all Loading... |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "platform/graphics/gpu/DrawingBuffer.h" | 31 #include "platform/graphics/gpu/DrawingBuffer.h" |
| 32 | 32 |
| 33 #include "gpu/GLES2/gl2extchromium.h" |
| 33 #include "gpu/command_buffer/client/gles2_interface.h" | 34 #include "gpu/command_buffer/client/gles2_interface.h" |
| 34 #include "gpu/command_buffer/common/capabilities.h" | 35 #include "gpu/command_buffer/common/capabilities.h" |
| 35 #include "platform/RuntimeEnabledFeatures.h" | 36 #include "platform/RuntimeEnabledFeatures.h" |
| 36 #include "platform/TraceEvent.h" | 37 #include "platform/TraceEvent.h" |
| 37 #include "platform/graphics/GraphicsLayer.h" | 38 #include "platform/graphics/GraphicsLayer.h" |
| 38 #include "platform/graphics/ImageBuffer.h" | 39 #include "platform/graphics/ImageBuffer.h" |
| 39 #include "platform/graphics/gpu/Extensions3DUtil.h" | 40 #include "platform/graphics/gpu/Extensions3DUtil.h" |
| 40 #include "public/platform/Platform.h" | 41 #include "public/platform/Platform.h" |
| 41 #include "public/platform/WebCompositorSupport.h" | 42 #include "public/platform/WebCompositorSupport.h" |
| 42 #include "public/platform/WebExternalBitmap.h" | 43 #include "public/platform/WebExternalBitmap.h" |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 else if (m_wantAlphaChannel && !m_premultipliedAlpha && premultiplyAlpha) | 563 else if (m_wantAlphaChannel && !m_premultipliedAlpha && premultiplyAlpha) |
| 563 unpackPremultiplyAlphaNeeded = GL_TRUE; | 564 unpackPremultiplyAlphaNeeded = GL_TRUE; |
| 564 | 565 |
| 565 gl->CopyTextureCHROMIUM(sourceTexture, texture, internalFormat, destType, fl
ipY, unpackPremultiplyAlphaNeeded, unpackUnpremultiplyAlphaNeeded); | 566 gl->CopyTextureCHROMIUM(sourceTexture, texture, internalFormat, destType, fl
ipY, unpackPremultiplyAlphaNeeded, unpackUnpremultiplyAlphaNeeded); |
| 566 | 567 |
| 567 gl->DeleteTextures(1, &sourceTexture); | 568 gl->DeleteTextures(1, &sourceTexture); |
| 568 | 569 |
| 569 const GLuint64 fenceSync = gl->InsertFenceSyncCHROMIUM(); | 570 const GLuint64 fenceSync = gl->InsertFenceSyncCHROMIUM(); |
| 570 | 571 |
| 571 gl->Flush(); | 572 gl->Flush(); |
| 572 GLbyte syncToken[24]; | 573 GLbyte syncToken[GL_SYNC_TOKEN_SIZE_CHROMIUM] = { 0 }; |
| 573 gl->GenSyncTokenCHROMIUM(fenceSync, syncToken); | 574 gl->GenSyncTokenCHROMIUM(fenceSync, syncToken); |
| 574 m_gl->WaitSyncTokenCHROMIUM(syncToken); | 575 m_gl->WaitSyncTokenCHROMIUM(syncToken); |
| 575 | 576 |
| 576 return true; | 577 return true; |
| 577 } | 578 } |
| 578 | 579 |
| 579 GLuint DrawingBuffer::framebuffer() const | 580 GLuint DrawingBuffer::framebuffer() const |
| 580 { | 581 { |
| 581 return m_fbo; | 582 return m_fbo; |
| 582 } | 583 } |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 | 1109 |
| 1109 void DrawingBuffer::restoreTextureBindings() | 1110 void DrawingBuffer::restoreTextureBindings() |
| 1110 { | 1111 { |
| 1111 // This class potentially modifies the bindings for GL_TEXTURE_2D and | 1112 // This class potentially modifies the bindings for GL_TEXTURE_2D and |
| 1112 // GL_TEXTURE_RECTANGLE. Only GL_TEXTURE_2D needs to be restored since | 1113 // GL_TEXTURE_RECTANGLE. Only GL_TEXTURE_2D needs to be restored since |
| 1113 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE. | 1114 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE. |
| 1114 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding); | 1115 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding); |
| 1115 } | 1116 } |
| 1116 | 1117 |
| 1117 } // namespace blink | 1118 } // namespace blink |
| OLD | NEW |