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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp

Issue 2628773002: Replaced RefPtr::release with std::move in Source/platform. (Closed)
Patch Set: Created 3 years, 11 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/Source/platform/graphics/ImageSource.cpp ('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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 class SkiaImageDecoder final : public SkImageDeserializer { 60 class SkiaImageDecoder final : public SkImageDeserializer {
61 public: 61 public:
62 sk_sp<SkImage> makeFromMemory(const void* data, 62 sk_sp<SkImage> makeFromMemory(const void* data,
63 size_t length, 63 size_t length,
64 const SkIRect* subset) override { 64 const SkIRect* subset) override {
65 // No need to copy the data; this decodes immediately. 65 // No need to copy the data; this decodes immediately.
66 RefPtr<SegmentReader> segmentReader = 66 RefPtr<SegmentReader> segmentReader =
67 SegmentReader::createFromSkData(SkData::MakeWithoutCopy(data, length)); 67 SegmentReader::createFromSkData(SkData::MakeWithoutCopy(data, length));
68 std::unique_ptr<ImageDecoder> imageDecoder = ImageDecoder::create( 68 std::unique_ptr<ImageDecoder> imageDecoder = ImageDecoder::create(
69 segmentReader.release(), true, ImageDecoder::AlphaPremultiplied, 69 std::move(segmentReader), true, ImageDecoder::AlphaPremultiplied,
70 ColorBehavior::ignore()); 70 ColorBehavior::ignore());
71 if (!imageDecoder) 71 if (!imageDecoder)
72 return nullptr; 72 return nullptr;
73 73
74 ImageFrame* frame = imageDecoder->frameBufferAtIndex(0); 74 ImageFrame* frame = imageDecoder->frameBufferAtIndex(0);
75 return (frame && !imageDecoder->failed()) 75 return (frame && !imageDecoder->failed())
76 ? frame->finalizePixelsAndGetImage() 76 ? frame->finalizePixelsAndGetImage()
77 : nullptr; 77 : nullptr;
78 } 78 }
79 sk_sp<SkImage> makeFromData(SkData* data, const SkIRect* subset) override { 79 sk_sp<SkImage> makeFromData(SkData* data, const SkIRect* subset) override {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 196 }
197 197
198 std::unique_ptr<JSONArray> PictureSnapshot::snapshotCommandLog() const { 198 std::unique_ptr<JSONArray> PictureSnapshot::snapshotCommandLog() const {
199 const SkIRect bounds = m_picture->cullRect().roundOut(); 199 const SkIRect bounds = m_picture->cullRect().roundOut();
200 LoggingCanvas canvas(bounds.width(), bounds.height()); 200 LoggingCanvas canvas(bounds.width(), bounds.height());
201 m_picture->playback(&canvas); 201 m_picture->playback(&canvas);
202 return canvas.log(); 202 return canvas.log();
203 } 203 }
204 204
205 } // namespace blink 205 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/ImageSource.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698