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

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

Issue 2420203002: Implement convertToBlob() in OffscreenCanvas (Closed)
Patch Set: webgl layout test 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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 // ImageData allocation faillure 738 // ImageData allocation faillure
739 TaskRunnerHelper::get(TaskType::CanvasBlobSerialization, &document()) 739 TaskRunnerHelper::get(TaskType::CanvasBlobSerialization, &document())
740 ->postTask(BLINK_FROM_HERE, 740 ->postTask(BLINK_FROM_HERE,
741 WTF::bind(&BlobCallback::handleEvent, 741 WTF::bind(&BlobCallback::handleEvent,
742 wrapPersistent(callback), nullptr)); 742 wrapPersistent(callback), nullptr));
743 return; 743 return;
744 } 744 }
745 745
746 CanvasAsyncBlobCreator* asyncCreator = CanvasAsyncBlobCreator::create( 746 CanvasAsyncBlobCreator* asyncCreator = CanvasAsyncBlobCreator::create(
747 imageData->data(), encodingMimeType, imageData->size(), callback, 747 imageData->data(), encodingMimeType, imageData->size(), callback,
748 startTime, document()); 748 startTime, &document(), nullptr);
749 749
750 bool useIdlePeriodScheduling = (encodingMimeType != "image/webp"); 750 asyncCreator->scheduleAsyncBlobCreation(quality);
751 asyncCreator->scheduleAsyncBlobCreation(useIdlePeriodScheduling, quality);
752 } 751 }
753 752
754 void HTMLCanvasElement::addListener(CanvasDrawListener* listener) { 753 void HTMLCanvasElement::addListener(CanvasDrawListener* listener) {
755 m_listeners.add(listener); 754 m_listeners.add(listener);
756 } 755 }
757 756
758 void HTMLCanvasElement::removeListener(CanvasDrawListener* listener) { 757 void HTMLCanvasElement::removeListener(CanvasDrawListener* listener) {
759 m_listeners.remove(listener); 758 m_listeners.remove(listener);
760 } 759 }
761 760
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1345 mojom::blink::OffscreenCanvasSurfacePtr service; 1344 mojom::blink::OffscreenCanvasSurfacePtr service;
1346 Platform::current()->interfaceProvider()->getInterface( 1345 Platform::current()->interfaceProvider()->getInterface(
1347 mojo::GetProxy(&service)); 1346 mojo::GetProxy(&service));
1348 m_surfaceLayerBridge = 1347 m_surfaceLayerBridge =
1349 wrapUnique(new CanvasSurfaceLayerBridge(std::move(service))); 1348 wrapUnique(new CanvasSurfaceLayerBridge(std::move(service)));
1350 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), 1349 return m_surfaceLayerBridge->createSurfaceLayer(this->width(),
1351 this->height()); 1350 this->height());
1352 } 1351 }
1353 1352
1354 } // namespace blink 1353 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698