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

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

Issue 1832263002: Remove WGC3D typedefs and move WebGraphicsInfo to Platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: webgraphicsinfo: rebase Created 4 years, 8 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 // The canvas is stored in a premultiplied format, so unpremultiply if neces sary. 224 // The canvas is stored in a premultiplied format, so unpremultiply if neces sary.
225 // The canvas is stored in an inverted position, so the flip semantics are r eversed. 225 // The canvas is stored in an inverted position, so the flip semantics are r eversed.
226 gl->CopyTextureCHROMIUM(sourceTexture, texture, internalFormat, destType, fl ipY ? GL_FALSE : GL_TRUE, GL_FALSE, premultiplyAlpha ? GL_FALSE : GL_TRUE); 226 gl->CopyTextureCHROMIUM(sourceTexture, texture, internalFormat, destType, fl ipY ? GL_FALSE : GL_TRUE, GL_FALSE, premultiplyAlpha ? GL_FALSE : GL_TRUE);
227 227
228 gl->DeleteTextures(1, &sourceTexture); 228 gl->DeleteTextures(1, &sourceTexture);
229 229
230 const GLuint64 contextFenceSync = gl->InsertFenceSyncCHROMIUM(); 230 const GLuint64 contextFenceSync = gl->InsertFenceSyncCHROMIUM();
231 231
232 gl->Flush(); 232 gl->Flush();
233 233
234 WGC3Dbyte syncToken[24]; 234 GLbyte syncToken[24];
235 gl->GenSyncTokenCHROMIUM(contextFenceSync, syncToken); 235 gl->GenSyncTokenCHROMIUM(contextFenceSync, syncToken);
236 sharedGL->WaitSyncTokenCHROMIUM(syncToken); 236 sharedGL->WaitSyncTokenCHROMIUM(syncToken);
237 237
238 // Undo grContext texture binding changes introduced in this function 238 // Undo grContext texture binding changes introduced in this function
239 provider->grContext()->resetContext(kTextureBinding_GrGLBackendState); 239 provider->grContext()->resetContext(kTextureBinding_GrGLBackendState);
240 240
241 return true; 241 return true;
242 } 242 }
243 243
244 bool ImageBuffer::copyRenderingResultsFromDrawingBuffer(DrawingBuffer* drawingBu ffer, SourceDrawingBuffer sourceBuffer) 244 bool ImageBuffer::copyRenderingResultsFromDrawingBuffer(DrawingBuffer* drawingBu ffer, SourceDrawingBuffer sourceBuffer)
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); 403 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
404 404
405 Vector<unsigned char> result; 405 Vector<unsigned char> result;
406 if (!encodeImage(mimeType, quality, &result)) 406 if (!encodeImage(mimeType, quality, &result))
407 return "data:,"; 407 return "data:,";
408 408
409 return "data:" + mimeType + ";base64," + base64Encode(result); 409 return "data:" + mimeType + ";base64," + base64Encode(result);
410 } 410 }
411 411
412 } // namespace blink 412 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698