Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp

Issue 2190733003: webgl: Zero-initialize the SyncToken before calling GenSyncTokenCHROMIUM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 else if (m_wantAlphaChannel && !m_premultipliedAlpha && premultiplyAlpha) 548 else if (m_wantAlphaChannel && !m_premultipliedAlpha && premultiplyAlpha)
548 unpackPremultiplyAlphaNeeded = GL_TRUE; 549 unpackPremultiplyAlphaNeeded = GL_TRUE;
549 550
550 gl->CopyTextureCHROMIUM(sourceTexture, texture, internalFormat, destType, fl ipY, unpackPremultiplyAlphaNeeded, unpackUnpremultiplyAlphaNeeded); 551 gl->CopyTextureCHROMIUM(sourceTexture, texture, internalFormat, destType, fl ipY, unpackPremultiplyAlphaNeeded, unpackUnpremultiplyAlphaNeeded);
551 552
552 gl->DeleteTextures(1, &sourceTexture); 553 gl->DeleteTextures(1, &sourceTexture);
553 554
554 const GLuint64 fenceSync = gl->InsertFenceSyncCHROMIUM(); 555 const GLuint64 fenceSync = gl->InsertFenceSyncCHROMIUM();
555 556
556 gl->Flush(); 557 gl->Flush();
557 GLbyte syncToken[24]; 558 GLbyte syncToken[GL_SYNC_TOKEN_SIZE_CHROMIUM] = { 0 };
558 gl->GenSyncTokenCHROMIUM(fenceSync, syncToken); 559 gl->GenSyncTokenCHROMIUM(fenceSync, syncToken);
559 m_gl->WaitSyncTokenCHROMIUM(syncToken); 560 m_gl->WaitSyncTokenCHROMIUM(syncToken);
560 561
561 return true; 562 return true;
562 } 563 }
563 564
564 GLuint DrawingBuffer::framebuffer() const 565 GLuint DrawingBuffer::framebuffer() const
565 { 566 {
566 return m_fbo; 567 return m_fbo;
567 } 568 }
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 1089
1089 void DrawingBuffer::restoreTextureBindings() 1090 void DrawingBuffer::restoreTextureBindings()
1090 { 1091 {
1091 // This class potentially modifies the bindings for GL_TEXTURE_2D and 1092 // This class potentially modifies the bindings for GL_TEXTURE_2D and
1092 // GL_TEXTURE_RECTANGLE. Only GL_TEXTURE_2D needs to be restored since 1093 // GL_TEXTURE_RECTANGLE. Only GL_TEXTURE_2D needs to be restored since
1093 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE. 1094 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE.
1094 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding); 1095 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding);
1095 } 1096 }
1096 1097
1097 } // namespace blink 1098 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698