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

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

Issue 2420203002: Implement convertToBlob() in OffscreenCanvas (Closed)
Patch Set: rebase and fix global-interface-listing-service-worker-expected.txt Created 4 years, 2 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 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 // ImageData allocation faillure 739 // ImageData allocation faillure
740 TaskRunnerHelper::get(TaskType::CanvasBlobSerialization, &document()) 740 TaskRunnerHelper::get(TaskType::CanvasBlobSerialization, &document())
741 ->postTask(BLINK_FROM_HERE, 741 ->postTask(BLINK_FROM_HERE,
742 WTF::bind(&BlobCallback::handleEvent, 742 WTF::bind(&BlobCallback::handleEvent,
743 wrapPersistent(callback), nullptr)); 743 wrapPersistent(callback), nullptr));
744 return; 744 return;
745 } 745 }
746 746
747 CanvasAsyncBlobCreator* asyncCreator = CanvasAsyncBlobCreator::create( 747 CanvasAsyncBlobCreator* asyncCreator = CanvasAsyncBlobCreator::create(
748 imageData->data(), encodingMimeType, imageData->size(), callback, 748 imageData->data(), encodingMimeType, imageData->size(), callback,
749 startTime, document()); 749 startTime, &document());
750 750
751 bool useIdlePeriodScheduling = (encodingMimeType != "image/webp"); 751 asyncCreator->scheduleAsyncBlobCreation(quality);
752 asyncCreator->scheduleAsyncBlobCreation(useIdlePeriodScheduling, quality);
753 } 752 }
754 753
755 void HTMLCanvasElement::addListener(CanvasDrawListener* listener) { 754 void HTMLCanvasElement::addListener(CanvasDrawListener* listener) {
756 m_listeners.add(listener); 755 m_listeners.add(listener);
757 } 756 }
758 757
759 void HTMLCanvasElement::removeListener(CanvasDrawListener* listener) { 758 void HTMLCanvasElement::removeListener(CanvasDrawListener* listener) {
760 m_listeners.remove(listener); 759 m_listeners.remove(listener);
761 } 760 }
762 761
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 mojom::blink::OffscreenCanvasSurfacePtr service; 1345 mojom::blink::OffscreenCanvasSurfacePtr service;
1347 Platform::current()->interfaceProvider()->getInterface( 1346 Platform::current()->interfaceProvider()->getInterface(
1348 mojo::GetProxy(&service)); 1347 mojo::GetProxy(&service));
1349 m_surfaceLayerBridge = 1348 m_surfaceLayerBridge =
1350 wrapUnique(new CanvasSurfaceLayerBridge(std::move(service))); 1349 wrapUnique(new CanvasSurfaceLayerBridge(std::move(service)));
1351 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), 1350 return m_surfaceLayerBridge->createSurfaceLayer(this->width(),
1352 this->height()); 1351 this->height());
1353 } 1352 }
1354 1353
1355 } // namespace blink 1354 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/core_idl_files.gni ('k') | third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698