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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 | 667 |
668 void HTMLCanvasElement::toBlob(BlobCallback* callback, const String& mimeType, c
onst ScriptValue& qualityArgument, ExceptionState& exceptionState) | 668 void HTMLCanvasElement::toBlob(BlobCallback* callback, const String& mimeType, c
onst ScriptValue& qualityArgument, ExceptionState& exceptionState) |
669 { | 669 { |
670 if (!originClean()) { | 670 if (!originClean()) { |
671 exceptionState.throwSecurityError("Tainted canvases may not be exported.
"); | 671 exceptionState.throwSecurityError("Tainted canvases may not be exported.
"); |
672 return; | 672 return; |
673 } | 673 } |
674 | 674 |
675 if (!isPaintable()) { | 675 if (!isPaintable()) { |
676 // If the canvas element's bitmap has no pixels | 676 // If the canvas element's bitmap has no pixels |
677 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR
OM_HERE, bind(&BlobCallback::handleEvent, wrapPersistent(callback), nullptr)); | 677 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR
OM_HERE, WTF::bind(&BlobCallback::handleEvent, wrapPersistent(callback), nullptr
)); |
678 return; | 678 return; |
679 } | 679 } |
680 | 680 |
681 double quality = UndefinedQualityValue; | 681 double quality = UndefinedQualityValue; |
682 if (!qualityArgument.isEmpty()) { | 682 if (!qualityArgument.isEmpty()) { |
683 v8::Local<v8::Value> v8Value = qualityArgument.v8Value(); | 683 v8::Local<v8::Value> v8Value = qualityArgument.v8Value(); |
684 if (v8Value->IsNumber()) { | 684 if (v8Value->IsNumber()) { |
685 quality = v8Value.As<v8::Number>()->Value(); | 685 quality = v8Value.As<v8::Number>()->Value(); |
686 } | 686 } |
687 } | 687 } |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1187 | 1187 |
1188 bool HTMLCanvasElement::createSurfaceLayer() | 1188 bool HTMLCanvasElement::createSurfaceLayer() |
1189 { | 1189 { |
1190 DCHECK(!m_surfaceLayerBridge); | 1190 DCHECK(!m_surfaceLayerBridge); |
1191 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); | 1191 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); |
1192 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); | 1192 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); |
1193 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); | 1193 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); |
1194 } | 1194 } |
1195 | 1195 |
1196 } // namespace blink | 1196 } // namespace blink |
OLD | NEW |