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

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

Issue 2957513002: Removed calls to RefPtr::Release in return statements with auto move. (Closed)
Patch Set: rebased Created 3 years, 5 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 // 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/imagebitmap/ImageBitmap.h" 5 #include "core/imagebitmap/ImageBitmap.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "core/html/HTMLCanvasElement.h" 8 #include "core/html/HTMLCanvasElement.h"
9 #include "core/html/HTMLVideoElement.h" 9 #include "core/html/HTMLVideoElement.h"
10 #include "core/html/ImageData.h" 10 #include "core/html/ImageData.h"
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 961
962 PassRefPtr<Uint8Array> ImageBitmap::CopyBitmapData(AlphaDisposition alpha_op, 962 PassRefPtr<Uint8Array> ImageBitmap::CopyBitmapData(AlphaDisposition alpha_op,
963 DataColorFormat format) { 963 DataColorFormat format) {
964 SkImageInfo info = SkImageInfo::Make( 964 SkImageInfo info = SkImageInfo::Make(
965 width(), height(), 965 width(), height(),
966 (format == kRGBAColorType) ? kRGBA_8888_SkColorType : kN32_SkColorType, 966 (format == kRGBAColorType) ? kRGBA_8888_SkColorType : kN32_SkColorType,
967 (alpha_op == kPremultiplyAlpha) ? kPremul_SkAlphaType 967 (alpha_op == kPremultiplyAlpha) ? kPremul_SkAlphaType
968 : kUnpremul_SkAlphaType); 968 : kUnpremul_SkAlphaType);
969 RefPtr<Uint8Array> dst_pixels = 969 RefPtr<Uint8Array> dst_pixels =
970 CopySkImageData(image_->ImageForCurrentFrame(), info); 970 CopySkImageData(image_->ImageForCurrentFrame(), info);
971 return dst_pixels.Release(); 971 return dst_pixels;
972 } 972 }
973 973
974 unsigned long ImageBitmap::width() const { 974 unsigned long ImageBitmap::width() const {
975 if (!image_) 975 if (!image_)
976 return 0; 976 return 0;
977 DCHECK_GT(image_->width(), 0); 977 DCHECK_GT(image_->width(), 0);
978 return image_->width(); 978 return image_->width();
979 } 979 }
980 980
981 unsigned long ImageBitmap::height() const { 981 unsigned long ImageBitmap::height() const {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 void ImageBitmap::AdjustDrawRects(FloatRect* src_rect, 1032 void ImageBitmap::AdjustDrawRects(FloatRect* src_rect,
1033 FloatRect* dst_rect) const {} 1033 FloatRect* dst_rect) const {}
1034 1034
1035 FloatSize ImageBitmap::ElementSize(const FloatSize&) const { 1035 FloatSize ImageBitmap::ElementSize(const FloatSize&) const {
1036 return FloatSize(width(), height()); 1036 return FloatSize(width(), height());
1037 } 1037 }
1038 1038
1039 DEFINE_TRACE(ImageBitmap) {} 1039 DEFINE_TRACE(ImageBitmap) {}
1040 1040
1041 } // namespace blink 1041 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698