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

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

Issue 1817323003: Revert of Remove create/delete methods from WebGraphicsContext3D. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@complex-casts
Patch Set: Created 4 years, 9 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
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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 sharedGL->GenSyncTokenCHROMIUM(sharedFenceSync, mailbox->syncToken); 217 sharedGL->GenSyncTokenCHROMIUM(sharedFenceSync, mailbox->syncToken);
218 mailbox->validSyncToken = true; 218 mailbox->validSyncToken = true;
219 gl->WaitSyncTokenCHROMIUM(mailbox->syncToken); 219 gl->WaitSyncTokenCHROMIUM(mailbox->syncToken);
220 220
221 Platform3DObject sourceTexture = gl->CreateAndConsumeTextureCHROMIUM(texture Info->fTarget, mailbox->name); 221 Platform3DObject sourceTexture = gl->CreateAndConsumeTextureCHROMIUM(texture Info->fTarget, mailbox->name);
222 222
223 // The canvas is stored in a premultiplied format, so unpremultiply if neces sary. 223 // The canvas is stored in a premultiplied format, so unpremultiply if neces sary.
224 // The canvas is stored in an inverted position, so the flip semantics are r eversed. 224 // The canvas is stored in an inverted position, so the flip semantics are r eversed.
225 gl->CopyTextureCHROMIUM(sourceTexture, texture, internalFormat, destType, fl ipY ? GL_FALSE : GL_TRUE, GL_FALSE, premultiplyAlpha ? GL_FALSE : GL_TRUE); 225 gl->CopyTextureCHROMIUM(sourceTexture, texture, internalFormat, destType, fl ipY ? GL_FALSE : GL_TRUE, GL_FALSE, premultiplyAlpha ? GL_FALSE : GL_TRUE);
226 226
227 gl->DeleteTextures(1, &sourceTexture); 227 context->deleteTexture(sourceTexture);
228 228
229 const GLuint64 contextFenceSync = gl->InsertFenceSyncCHROMIUM(); 229 const GLuint64 contextFenceSync = gl->InsertFenceSyncCHROMIUM();
230 230
231 gl->Flush(); 231 gl->Flush();
232 232
233 WGC3Dbyte syncToken[24]; 233 WGC3Dbyte syncToken[24];
234 gl->GenSyncTokenCHROMIUM(contextFenceSync, syncToken); 234 gl->GenSyncTokenCHROMIUM(contextFenceSync, syncToken);
235 sharedGL->WaitSyncTokenCHROMIUM(syncToken); 235 sharedGL->WaitSyncTokenCHROMIUM(syncToken);
236 236
237 // Undo grContext texture binding changes introduced in this function 237 // Undo grContext texture binding changes introduced in this function
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); 404 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
405 405
406 Vector<unsigned char> result; 406 Vector<unsigned char> result;
407 if (!encodeImage(mimeType, quality, &result)) 407 if (!encodeImage(mimeType, quality, &result))
408 return "data:,"; 408 return "data:,";
409 409
410 return "data:" + mimeType + ";base64," + base64Encode(result); 410 return "data:" + mimeType + ";base64," + base64Encode(result);
411 } 411 }
412 412
413 } // namespace blink 413 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698