| 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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 v8::Local<v8::Value> v8Value = qualityArgument.v8Value(); | 691 v8::Local<v8::Value> v8Value = qualityArgument.v8Value(); |
| 692 if (v8Value->IsNumber()) { | 692 if (v8Value->IsNumber()) { |
| 693 quality = v8Value.As<v8::Number>()->Value(); | 693 quality = v8Value.As<v8::Number>()->Value(); |
| 694 } | 694 } |
| 695 } | 695 } |
| 696 | 696 |
| 697 String encodingMimeType = toEncodingMimeType(mimeType, EncodeReasonToBlobCal
lback); | 697 String encodingMimeType = toEncodingMimeType(mimeType, EncodeReasonToBlobCal
lback); |
| 698 | 698 |
| 699 ImageData* imageData = toImageData(BackBuffer, SnapshotReasonToBlob); | 699 ImageData* imageData = toImageData(BackBuffer, SnapshotReasonToBlob); |
| 700 | 700 |
| 701 CanvasAsyncBlobCreator* asyncCreator = CanvasAsyncBlobCreator::create(imageD
ata->data(), encodingMimeType, imageData->size(), callback, startTime); | 701 CanvasAsyncBlobCreator* asyncCreator = CanvasAsyncBlobCreator::create(imageD
ata->data(), encodingMimeType, imageData->size(), callback, startTime, &document
()); |
| 702 | 702 |
| 703 bool useIdlePeriodScheduling = (encodingMimeType != "image/webp"); | 703 bool useIdlePeriodScheduling = (encodingMimeType != "image/webp"); |
| 704 asyncCreator->scheduleAsyncBlobCreation(useIdlePeriodScheduling, quality); | 704 asyncCreator->scheduleAsyncBlobCreation(useIdlePeriodScheduling, quality); |
| 705 } | 705 } |
| 706 | 706 |
| 707 void HTMLCanvasElement::addListener(CanvasDrawListener* listener) | 707 void HTMLCanvasElement::addListener(CanvasDrawListener* listener) |
| 708 { | 708 { |
| 709 m_listeners.add(listener); | 709 m_listeners.add(listener); |
| 710 } | 710 } |
| 711 | 711 |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 | 1195 |
| 1196 bool HTMLCanvasElement::createSurfaceLayer() | 1196 bool HTMLCanvasElement::createSurfaceLayer() |
| 1197 { | 1197 { |
| 1198 DCHECK(!m_surfaceLayerBridge); | 1198 DCHECK(!m_surfaceLayerBridge); |
| 1199 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); | 1199 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); |
| 1200 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); | 1200 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); |
| 1201 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); | 1201 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); |
| 1202 } | 1202 } |
| 1203 | 1203 |
| 1204 } // namespace blink | 1204 } // namespace blink |
| OLD | NEW |