| 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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 v8::Local<v8::Value> v8Value = qualityArgument.v8Value(); | 725 v8::Local<v8::Value> v8Value = qualityArgument.v8Value(); |
| 726 if (v8Value->IsNumber()) { | 726 if (v8Value->IsNumber()) { |
| 727 quality = v8Value.As<v8::Number>()->Value(); | 727 quality = v8Value.As<v8::Number>()->Value(); |
| 728 } | 728 } |
| 729 } | 729 } |
| 730 | 730 |
| 731 String encodingMimeType = toEncodingMimeType(mimeType, EncodeReasonToBlobCal
lback); | 731 String encodingMimeType = toEncodingMimeType(mimeType, EncodeReasonToBlobCal
lback); |
| 732 | 732 |
| 733 ImageData* imageData = toImageData(BackBuffer, SnapshotReasonToBlob); | 733 ImageData* imageData = toImageData(BackBuffer, SnapshotReasonToBlob); |
| 734 | 734 |
| 735 CanvasAsyncBlobCreator* asyncCreator = CanvasAsyncBlobCreator::create(imageD
ata->data(), encodingMimeType, imageData->size(), callback, startTime, &document
()); | 735 CanvasAsyncBlobCreator* asyncCreator = CanvasAsyncBlobCreator::create(imageD
ata->data(), encodingMimeType, imageData->size(), callback, startTime, document(
)); |
| 736 | 736 |
| 737 bool useIdlePeriodScheduling = (encodingMimeType != "image/webp"); | 737 bool useIdlePeriodScheduling = (encodingMimeType != "image/webp"); |
| 738 asyncCreator->scheduleAsyncBlobCreation(useIdlePeriodScheduling, quality); | 738 asyncCreator->scheduleAsyncBlobCreation(useIdlePeriodScheduling, quality); |
| 739 } | 739 } |
| 740 | 740 |
| 741 void HTMLCanvasElement::addListener(CanvasDrawListener* listener) | 741 void HTMLCanvasElement::addListener(CanvasDrawListener* listener) |
| 742 { | 742 { |
| 743 m_listeners.add(listener); | 743 m_listeners.add(listener); |
| 744 } | 744 } |
| 745 | 745 |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1236 | 1236 |
| 1237 bool HTMLCanvasElement::createSurfaceLayer() | 1237 bool HTMLCanvasElement::createSurfaceLayer() |
| 1238 { | 1238 { |
| 1239 DCHECK(!m_surfaceLayerBridge); | 1239 DCHECK(!m_surfaceLayerBridge); |
| 1240 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); | 1240 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); |
| 1241 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); | 1241 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); |
| 1242 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); | 1242 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); |
| 1243 } | 1243 } |
| 1244 | 1244 |
| 1245 } // namespace blink | 1245 } // namespace blink |
| OLD | NEW |