| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 } | 281 } |
| 282 } else { | 282 } else { |
| 283 m_gl->CopyTextureCHROMIUM(m_colorBuffer.textureId, frontColorBufferMailb
ox->textureInfo.textureId, frontColorBufferMailbox->textureInfo.parameters.inter
nalColorFormat, GL_UNSIGNED_BYTE, GL_FALSE, GL_FALSE, GL_FALSE); | 283 m_gl->CopyTextureCHROMIUM(m_colorBuffer.textureId, frontColorBufferMailb
ox->textureInfo.textureId, frontColorBufferMailbox->textureInfo.parameters.inter
nalColorFormat, GL_UNSIGNED_BYTE, GL_FALSE, GL_FALSE, GL_FALSE); |
| 284 } | 284 } |
| 285 | 285 |
| 286 restoreFramebufferBindings(); | 286 restoreFramebufferBindings(); |
| 287 m_contentsChanged = false; | 287 m_contentsChanged = false; |
| 288 | 288 |
| 289 m_gl->ProduceTextureDirectCHROMIUM(frontColorBufferMailbox->textureInfo.text
ureId, frontColorBufferMailbox->textureInfo.parameters.target, frontColorBufferM
ailbox->mailbox.name); | 289 m_gl->ProduceTextureDirectCHROMIUM(frontColorBufferMailbox->textureInfo.text
ureId, frontColorBufferMailbox->textureInfo.parameters.target, frontColorBufferM
ailbox->mailbox.name); |
| 290 const GLuint64 fenceSync = m_gl->InsertFenceSyncCHROMIUM(); | 290 const GLuint64 fenceSync = m_gl->InsertFenceSyncCHROMIUM(); |
| 291 if (RuntimeEnabledFeatures::webGLImageChromiumEnabled()) |
| 292 m_gl->DescheduleUntilFinishedCHROMIUM(); |
| 291 m_gl->Flush(); | 293 m_gl->Flush(); |
| 292 m_gl->GenSyncTokenCHROMIUM(fenceSync, frontColorBufferMailbox->mailbox.syncT
oken); | 294 m_gl->GenSyncTokenCHROMIUM(fenceSync, frontColorBufferMailbox->mailbox.syncT
oken); |
| 293 frontColorBufferMailbox->mailbox.validSyncToken = true; | 295 frontColorBufferMailbox->mailbox.validSyncToken = true; |
| 294 frontColorBufferMailbox->mailbox.allowOverlay = frontColorBufferMailbox->tex
tureInfo.imageId != 0; | 296 frontColorBufferMailbox->mailbox.allowOverlay = frontColorBufferMailbox->tex
tureInfo.imageId != 0; |
| 295 frontColorBufferMailbox->mailbox.textureTarget = frontColorBufferMailbox->te
xtureInfo.parameters.target; | 297 frontColorBufferMailbox->mailbox.textureTarget = frontColorBufferMailbox->te
xtureInfo.parameters.target; |
| 296 frontColorBufferMailbox->mailbox.textureSize = WebSize(m_size.width(), m_siz
e.height()); | 298 frontColorBufferMailbox->mailbox.textureSize = WebSize(m_size.width(), m_siz
e.height()); |
| 299 frontColorBufferMailbox->mailbox.gpuMemoryBufferId = frontColorBufferMailbox
->textureInfo.gpuMemoryBufferId; |
| 297 setBufferClearNeeded(true); | 300 setBufferClearNeeded(true); |
| 298 | 301 |
| 299 // set m_parentDrawingBuffer to make sure 'this' stays alive as long as it h
as live mailboxes | 302 // set m_parentDrawingBuffer to make sure 'this' stays alive as long as it h
as live mailboxes |
| 300 ASSERT(!frontColorBufferMailbox->m_parentDrawingBuffer); | 303 ASSERT(!frontColorBufferMailbox->m_parentDrawingBuffer); |
| 301 frontColorBufferMailbox->m_parentDrawingBuffer = this; | 304 frontColorBufferMailbox->m_parentDrawingBuffer = this; |
| 302 *outMailbox = frontColorBufferMailbox->mailbox; | 305 *outMailbox = frontColorBufferMailbox->mailbox; |
| 303 m_frontColorBuffer = { frontColorBufferMailbox->textureInfo, frontColorBuffe
rMailbox->mailbox }; | 306 m_frontColorBuffer = { frontColorBufferMailbox->textureInfo, frontColorBuffe
rMailbox->mailbox }; |
| 304 return true; | 307 return true; |
| 305 } | 308 } |
| 306 | 309 |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 | 1079 |
| 1077 void DrawingBuffer::restoreTextureBindings() | 1080 void DrawingBuffer::restoreTextureBindings() |
| 1078 { | 1081 { |
| 1079 // This class potentially modifies the bindings for GL_TEXTURE_2D and | 1082 // This class potentially modifies the bindings for GL_TEXTURE_2D and |
| 1080 // GL_TEXTURE_RECTANGLE. Only GL_TEXTURE_2D needs to be restored since | 1083 // GL_TEXTURE_RECTANGLE. Only GL_TEXTURE_2D needs to be restored since |
| 1081 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE. | 1084 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE. |
| 1082 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding); | 1085 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding); |
| 1083 } | 1086 } |
| 1084 | 1087 |
| 1085 } // namespace blink | 1088 } // namespace blink |
| OLD | NEW |