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

Side by Side Diff: Source/core/html/HTMLCanvasElement.cpp

Issue 214153006: Oilpan: move ImageData to the oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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) 2004, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
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 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 exceptionState.throwSecurityError("Tainted canvases may not be exported. "); 377 exceptionState.throwSecurityError("Tainted canvases may not be exported. ");
378 return String(); 378 return String();
379 } 379 }
380 380
381 if (m_size.isEmpty() || !buffer()) 381 if (m_size.isEmpty() || !buffer())
382 return String("data:,"); 382 return String("data:,");
383 383
384 String encodingMimeType = toEncodingMimeType(mimeType); 384 String encodingMimeType = toEncodingMimeType(mimeType);
385 385
386 // Try to get ImageData first, as that may avoid lossy conversions. 386 // Try to get ImageData first, as that may avoid lossy conversions.
387 RefPtr<ImageData> imageData = getImageData(); 387 RefPtrWillBeRawPtr<ImageData> imageData = getImageData();
388 388
389 if (imageData) 389 if (imageData)
390 return ImageDataToDataURL(ImageDataBuffer(imageData->size(), imageData-> data()), encodingMimeType, quality); 390 return ImageDataToDataURL(ImageDataBuffer(imageData->size(), imageData-> data()), encodingMimeType, quality);
391 391
392 if (m_context) 392 if (m_context)
393 m_context->paintRenderingResultsToCanvas(); 393 m_context->paintRenderingResultsToCanvas();
394 394
395 return buffer()->toDataURL(encodingMimeType, quality); 395 return buffer()->toDataURL(encodingMimeType, quality);
396 } 396 }
397 397
398 PassRefPtr<ImageData> HTMLCanvasElement::getImageData() 398 PassRefPtrWillBeRawPtr<ImageData> HTMLCanvasElement::getImageData()
399 { 399 {
400 if (!m_context || !m_context->is3d()) 400 if (!m_context || !m_context->is3d())
401 return nullptr; 401 return nullptr;
402 return toWebGLRenderingContext(m_context.get())->paintRenderingResultsToImag eData(); 402 return toWebGLRenderingContext(m_context.get())->paintRenderingResultsToImag eData();
403 } 403 }
404 404
405 SecurityOrigin* HTMLCanvasElement::securityOrigin() const 405 SecurityOrigin* HTMLCanvasElement::securityOrigin() const
406 { 406 {
407 return document().securityOrigin(); 407 return document().securityOrigin();
408 } 408 }
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 { 653 {
654 return !originClean(); 654 return !originClean();
655 } 655 }
656 656
657 FloatSize HTMLCanvasElement::sourceSize() const 657 FloatSize HTMLCanvasElement::sourceSize() const
658 { 658 {
659 return FloatSize(width(), height()); 659 return FloatSize(width(), height());
660 } 660 }
661 661
662 } 662 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698