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

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

Issue 2253813002: Use ParentFrameTaskRunners for encodeImageOnEncoderThread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698