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

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

Issue 1809603004: Use ImageDecoder for createImageBitmap(HTMLImageElement, premultiplyAlpha=false) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: halfRed-->darkRed Created 4 years, 9 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 | « third_party/WebKit/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-image-bitmap-from-video.html ('k') | 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 "platform/image-decoders/ImageDecoder.h" 10 #include "platform/image-decoders/ImageDecoder.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 if (premultiplyAlpha) 165 if (premultiplyAlpha)
166 return StaticBitmapImage::create(skiaImage.release()); 166 return StaticBitmapImage::create(skiaImage.release());
167 return StaticBitmapImage::create(premulSkImageToUnPremul(skiaImage.get())); 167 return StaticBitmapImage::create(premulSkImageToUnPremul(skiaImage.get()));
168 } 168 }
169 169
170 ImageBitmap::ImageBitmap(HTMLImageElement* image, const IntRect& cropRect, Docum ent* document, const ImageBitmapOptions& options) 170 ImageBitmap::ImageBitmap(HTMLImageElement* image, const IntRect& cropRect, Docum ent* document, const ImageBitmapOptions& options)
171 { 171 {
172 bool flipY; 172 bool flipY;
173 parseOptions(options, flipY); 173 parseOptions(options, flipY);
174 174
175 m_image = cropImage(image->cachedImage()->getImage(), cropRect, flipY, m_isP remultiplied, PremultiplyAlpha); 175 m_image = cropImage(image->cachedImage()->getImage(), cropRect, flipY, m_isP remultiplied);
176 if (!m_image) 176 if (!m_image)
177 return; 177 return;
178 m_image->setOriginClean(!image->wouldTaintOrigin(document->getSecurityOrigin ())); 178 m_image->setOriginClean(!image->wouldTaintOrigin(document->getSecurityOrigin ()));
179 } 179 }
180 180
181 ImageBitmap::ImageBitmap(HTMLVideoElement* video, const IntRect& cropRect, Docum ent* document, const ImageBitmapOptions& options) 181 ImageBitmap::ImageBitmap(HTMLVideoElement* video, const IntRect& cropRect, Docum ent* document, const ImageBitmapOptions& options)
182 { 182 {
183 IntSize playerSize; 183 IntSize playerSize;
184 if (video->webMediaPlayer()) 184 if (video->webMediaPlayer())
185 playerSize = video->webMediaPlayer()->naturalSize(); 185 playerSize = video->webMediaPlayer()->naturalSize();
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 FloatSize ImageBitmap::elementSize(const FloatSize&) const 453 FloatSize ImageBitmap::elementSize(const FloatSize&) const
454 { 454 {
455 return FloatSize(width(), height()); 455 return FloatSize(width(), height());
456 } 456 }
457 457
458 DEFINE_TRACE(ImageBitmap) 458 DEFINE_TRACE(ImageBitmap)
459 { 459 {
460 } 460 }
461 461
462 } // namespace blink 462 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-image-bitmap-from-video.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698