OLD | NEW |
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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 String encodingMimeType = toEncodingMimeType(mimeType); | 567 String encodingMimeType = toEncodingMimeType(mimeType); |
568 | 568 |
569 ImageData* imageData = toImageData(BackBuffer); | 569 ImageData* imageData = toImageData(BackBuffer); |
570 ScopedDisposal<ImageData> disposer(imageData); | 570 ScopedDisposal<ImageData> disposer(imageData); |
571 | 571 |
572 // Perform image encoding | 572 // Perform image encoding |
573 Vector<char> encodedImage; | 573 Vector<char> encodedImage; |
574 ImageDataBuffer(imageData->size(), imageData->data()->data()).encodeImage(en
codingMimeType, qualityPtr, &encodedImage); | 574 ImageDataBuffer(imageData->size(), imageData->data()->data()).encodeImage(en
codingMimeType, qualityPtr, &encodedImage); |
575 resultBlob = File::create(encodedImage.data(), encodedImage.size(), encoding
MimeType); | 575 resultBlob = File::create(encodedImage.data(), encodedImage.size(), encoding
MimeType); |
576 | 576 |
577 Platform::current()->mainThread()->postTask(FROM_HERE, bind(&FileCallback::h
andleEvent, callback, resultBlob)); | 577 Platform::current()->mainThread()->taskRunner()->postTask(FROM_HERE, bind(&F
ileCallback::handleEvent, callback, resultBlob)); |
578 } | 578 } |
579 | 579 |
580 SecurityOrigin* HTMLCanvasElement::securityOrigin() const | 580 SecurityOrigin* HTMLCanvasElement::securityOrigin() const |
581 { | 581 { |
582 return document().securityOrigin(); | 582 return document().securityOrigin(); |
583 } | 583 } |
584 | 584 |
585 bool HTMLCanvasElement::originClean() const | 585 bool HTMLCanvasElement::originClean() const |
586 { | 586 { |
587 if (document().settings() && document().settings()->disableReadingFromCanvas
()) | 587 if (document().settings() && document().settings()->disableReadingFromCanvas
()) |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 { | 943 { |
944 return FloatSize(width(), height()); | 944 return FloatSize(width(), height()); |
945 } | 945 } |
946 | 946 |
947 bool HTMLCanvasElement::isOpaque() const | 947 bool HTMLCanvasElement::isOpaque() const |
948 { | 948 { |
949 return m_context && !m_context->hasAlpha(); | 949 return m_context && !m_context->hasAlpha(); |
950 } | 950 } |
951 | 951 |
952 } // blink | 952 } // blink |
OLD | NEW |