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

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

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Folded sync_point into sync_tokens Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
index 46d5362e87646632b3469c07389fc540a3bb24f2..7239d503adb6b005268c8e1892ed195a474247e3 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -307,7 +307,7 @@ bool DrawingBuffer::prepareMailbox(WebExternalTextureMailbox* outMailbox, WebExt
m_context->produceTextureDirectCHROMIUM(frontColorBufferMailbox->textureInfo.textureId, GL_TEXTURE_2D, frontColorBufferMailbox->mailbox.name);
m_context->flush();
- frontColorBufferMailbox->mailbox.syncPoint = m_context->insertSyncPoint();
+ frontColorBufferMailbox->mailbox.validSyncToken = m_context->insertSyncPoint(frontColorBufferMailbox->mailbox.syncToken);
frontColorBufferMailbox->mailbox.allowOverlay = frontColorBufferMailbox->textureInfo.imageId != 0;
setBufferClearNeeded(true);
@@ -329,7 +329,9 @@ void DrawingBuffer::mailboxReleased(const WebExternalTextureMailbox& mailbox, bo
for (size_t i = 0; i < m_textureMailboxes.size(); i++) {
RefPtr<MailboxInfo> mailboxInfo = m_textureMailboxes[i];
if (nameEquals(mailboxInfo->mailbox, mailbox)) {
- mailboxInfo->mailbox.syncPoint = mailbox.syncPoint;
+ memcpy(mailboxInfo->mailbox.syncToken, mailbox.syncToken,
+ sizeof(mailboxInfo->mailbox.syncToken));
+ mailboxInfo->mailbox.validSyncToken = mailbox.validSyncToken;
ASSERT(mailboxInfo->m_parentDrawingBuffer.get() == this);
mailboxInfo->m_parentDrawingBuffer.clear();
m_recycledMailboxQueue.prepend(mailboxInfo->mailbox);
@@ -369,9 +371,9 @@ PassRefPtr<DrawingBuffer::MailboxInfo> DrawingBuffer::recycledMailbox()
}
ASSERT(mailboxInfo);
- if (mailboxInfo->mailbox.syncPoint) {
- m_context->waitSyncPoint(mailboxInfo->mailbox.syncPoint);
- mailboxInfo->mailbox.syncPoint = 0;
+ if (mailboxInfo->mailbox.validSyncToken) {
+ m_context->waitSyncToken(mailboxInfo->mailbox.syncToken);
+ mailboxInfo->mailbox.validSyncToken = false;
}
if (mailboxInfo->size != m_size) {
@@ -397,8 +399,8 @@ void DrawingBuffer::deleteMailbox(const WebExternalTextureMailbox& mailbox)
{
for (size_t i = 0; i < m_textureMailboxes.size(); i++) {
if (nameEquals(m_textureMailboxes[i]->mailbox, mailbox)) {
- if (mailbox.syncPoint)
- m_context->waitSyncPoint(mailbox.syncPoint);
+ if (mailbox.validSyncToken)
+ m_context->waitSyncToken(mailbox.syncToken);
deleteChromiumImageForTexture(&m_textureMailboxes[i]->textureInfo);
@@ -506,10 +508,10 @@ bool DrawingBuffer::copyToPlatformTexture(WebGraphicsContext3D* context, Platfor
m_context->genMailboxCHROMIUM(mailbox.name);
m_context->produceTextureDirectCHROMIUM(textureId, GL_TEXTURE_2D, mailbox.name);
m_context->flush();
- mailbox.syncPoint = m_context->insertSyncPoint();
+ mailbox.validSyncToken = m_context->insertSyncPoint(mailbox.syncToken);
}
- context->waitSyncPoint(mailbox.syncPoint);
+ context->waitSyncToken(mailbox.syncToken);
Platform3DObject sourceTexture = context->createAndConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
GLboolean unpackPremultiplyAlphaNeeded = GL_FALSE;
@@ -524,7 +526,9 @@ bool DrawingBuffer::copyToPlatformTexture(WebGraphicsContext3D* context, Platfor
context->deleteTexture(sourceTexture);
context->flush();
- m_context->waitSyncPoint(context->insertSyncPoint());
+ GLbyte syncToken[24];
+ if (context->insertSyncPoint(syncToken))
+ m_context->waitSyncToken(syncToken);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698