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

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

Issue 2207253002: Unbind video texture from mailbox after copying to WebGL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment 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 | « gpu/command_buffer/service/mailbox_manager_sync.cc ('k') | 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) 2008, Google Inc. All rights reserved. 2 * Copyright (c) 2008, Google Inc. All rights reserved.
3 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 3 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 247
248 gl->DeleteTextures(1, &sourceTexture); 248 gl->DeleteTextures(1, &sourceTexture);
249 249
250 const GLuint64 contextFenceSync = gl->InsertFenceSyncCHROMIUM(); 250 const GLuint64 contextFenceSync = gl->InsertFenceSyncCHROMIUM();
251 251
252 gl->Flush(); 252 gl->Flush();
253 253
254 GLbyte syncToken[24]; 254 GLbyte syncToken[24];
255 gl->GenSyncTokenCHROMIUM(contextFenceSync, syncToken); 255 gl->GenSyncTokenCHROMIUM(contextFenceSync, syncToken);
256 sharedGL->WaitSyncTokenCHROMIUM(syncToken); 256 sharedGL->WaitSyncTokenCHROMIUM(syncToken);
257 // This disassociates the texture from the mailbox to avoid leaking the
258 // mapping between the two.
259 sharedGL->ProduceTextureDirectCHROMIUM(0, textureInfo->fTarget, mailbox->nam e);
257 260
258 // Undo grContext texture binding changes introduced in this function 261 // Undo grContext texture binding changes introduced in this function
259 provider->grContext()->resetContext(kTextureBinding_GrGLBackendState); 262 provider->grContext()->resetContext(kTextureBinding_GrGLBackendState);
260 263
261 return true; 264 return true;
262 } 265 }
263 266
264 bool ImageBuffer::copyRenderingResultsFromDrawingBuffer(DrawingBuffer* drawingBu ffer, SourceDrawingBuffer sourceBuffer) 267 bool ImageBuffer::copyRenderingResultsFromDrawingBuffer(DrawingBuffer* drawingBu ffer, SourceDrawingBuffer sourceBuffer)
265 { 268 {
266 if (!drawingBuffer || !m_surface->isAccelerated()) 269 if (!drawingBuffer || !m_surface->isAccelerated())
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); 464 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
462 465
463 Vector<unsigned char> result; 466 Vector<unsigned char> result;
464 if (!encodeImage(mimeType, quality, &result)) 467 if (!encodeImage(mimeType, quality, &result))
465 return "data:,"; 468 return "data:,";
466 469
467 return "data:" + mimeType + ";base64," + base64Encode(result); 470 return "data:" + mimeType + ";base64," + base64Encode(result);
468 } 471 }
469 472
470 } // namespace blink 473 } // namespace blink
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/mailbox_manager_sync.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698