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

Side by Side Diff: third_party/WebKit/Source/core/frame/ImageBitmap.cpp

Issue 2587433003: remove call to deprecated preroll() -- cc manages triggering/caching decodes (Closed)
Patch Set: Created 4 years 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/frame/ImageBitmap.h" 5 #include "core/frame/ImageBitmap.h"
6 6
7 #include "core/html/HTMLCanvasElement.h" 7 #include "core/html/HTMLCanvasElement.h"
8 #include "core/html/HTMLVideoElement.h" 8 #include "core/html/HTMLVideoElement.h"
9 #include "core/html/ImageData.h" 9 #include "core/html/ImageData.h"
10 #include "core/offscreencanvas/OffscreenCanvas.h" 10 #include "core/offscreencanvas/OffscreenCanvas.h"
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 applyColorSpaceConversion(croppedSkImage, parsedOptions); 499 applyColorSpaceConversion(croppedSkImage, parsedOptions);
500 if (parsedOptions.flipY) { 500 if (parsedOptions.flipY) {
501 return StaticBitmapImage::create(flipSkImageVertically( 501 return StaticBitmapImage::create(flipSkImageVertically(
502 croppedSkImage.get(), DontEnforceAlphaPremultiply, parsedOptions)); 502 croppedSkImage.get(), DontEnforceAlphaPremultiply, parsedOptions));
503 } 503 }
504 // Special case: The first parameter image is unpremul but we need to turn 504 // Special case: The first parameter image is unpremul but we need to turn
505 // it into premul. 505 // it into premul.
506 if (parsedOptions.premultiplyAlpha && imageFormat == DontPremultiplyAlpha) 506 if (parsedOptions.premultiplyAlpha && imageFormat == DontPremultiplyAlpha)
507 return StaticBitmapImage::create( 507 return StaticBitmapImage::create(
508 unPremulSkImageToPremul(croppedSkImage.get())); 508 unPremulSkImageToPremul(croppedSkImage.get()));
509 // Call preroll to trigger image decoding.
510 croppedSkImage->preroll();
511 return StaticBitmapImage::create(std::move(croppedSkImage)); 509 return StaticBitmapImage::create(std::move(croppedSkImage));
512 } 510 }
513 511
514 sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul( 512 sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(
515 parsedOptions.resizeWidth, parsedOptions.resizeHeight); 513 parsedOptions.resizeWidth, parsedOptions.resizeHeight);
516 if (!surface) 514 if (!surface)
517 return nullptr; 515 return nullptr;
518 if (srcRect.isEmpty()) 516 if (srcRect.isEmpty())
519 return StaticBitmapImage::create(surface->makeImageSnapshot()); 517 return StaticBitmapImage::create(surface->makeImageSnapshot());
520 518
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 void ImageBitmap::adjustDrawRects(FloatRect* srcRect, 1099 void ImageBitmap::adjustDrawRects(FloatRect* srcRect,
1102 FloatRect* dstRect) const {} 1100 FloatRect* dstRect) const {}
1103 1101
1104 FloatSize ImageBitmap::elementSize(const FloatSize&) const { 1102 FloatSize ImageBitmap::elementSize(const FloatSize&) const {
1105 return FloatSize(width(), height()); 1103 return FloatSize(width(), height());
1106 } 1104 }
1107 1105
1108 DEFINE_TRACE(ImageBitmap) {} 1106 DEFINE_TRACE(ImageBitmap) {}
1109 1107
1110 } // namespace blink 1108 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698