OLD | NEW |
---|---|
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 ImageDecoder::AlphaPremultiplied, ImageDecoder::GammaAndColorProfileIgno red); | 64 ImageDecoder::AlphaPremultiplied, ImageDecoder::GammaAndColorProfileIgno red); |
65 if (!imageDecoder) | 65 if (!imageDecoder) |
66 return false; | 66 return false; |
67 | 67 |
68 // No need to copy the data; this decodes immediately. | 68 // No need to copy the data; this decodes immediately. |
69 RefPtr<SegmentReader> segmentReader = SegmentReader::createFromSkData(SkData ::MakeWithoutCopy(data, length)); | 69 RefPtr<SegmentReader> segmentReader = SegmentReader::createFromSkData(SkData ::MakeWithoutCopy(data, length)); |
70 imageDecoder->setData(segmentReader.release(), true); | 70 imageDecoder->setData(segmentReader.release(), true); |
71 ImageFrame* frame = imageDecoder->frameBufferAtIndex(0); | 71 ImageFrame* frame = imageDecoder->frameBufferAtIndex(0); |
72 if (!frame) | 72 if (!frame) |
73 return true; | 73 return true; |
74 *result = frame->bitmap(); | 74 *result = frame->bitmap(); |
aleksandar.stojiljkovic
2016/09/21 20:56:57
Original code seems to be used only by devtools.
A
aleksandar.stojiljkovic
2016/09/22 09:41:19
Done. Removed the drawback.
| |
75 if (frame->getStatus() == ImageFrame::FrameComplete) | |
76 result->setImmutable(); | |
75 return true; | 77 return true; |
76 } | 78 } |
77 | 79 |
78 PassRefPtr<PictureSnapshot> PictureSnapshot::load(const Vector<RefPtr<TilePictur eStream>>& tiles) | 80 PassRefPtr<PictureSnapshot> PictureSnapshot::load(const Vector<RefPtr<TilePictur eStream>>& tiles) |
79 { | 81 { |
80 ASSERT(!tiles.isEmpty()); | 82 ASSERT(!tiles.isEmpty()); |
81 Vector<sk_sp<SkPicture>> pictures; | 83 Vector<sk_sp<SkPicture>> pictures; |
82 pictures.reserveCapacity(tiles.size()); | 84 pictures.reserveCapacity(tiles.size()); |
83 FloatRect unionRect; | 85 FloatRect unionRect; |
84 for (const auto& tileStream : tiles) { | 86 for (const auto& tileStream : tiles) { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
176 | 178 |
177 std::unique_ptr<JSONArray> PictureSnapshot::snapshotCommandLog() const | 179 std::unique_ptr<JSONArray> PictureSnapshot::snapshotCommandLog() const |
178 { | 180 { |
179 const SkIRect bounds = m_picture->cullRect().roundOut(); | 181 const SkIRect bounds = m_picture->cullRect().roundOut(); |
180 LoggingCanvas canvas(bounds.width(), bounds.height()); | 182 LoggingCanvas canvas(bounds.width(), bounds.height()); |
181 m_picture->playback(&canvas); | 183 m_picture->playback(&canvas); |
182 return canvas.log(); | 184 return canvas.log(); |
183 } | 185 } |
184 | 186 |
185 } // namespace blink | 187 } // namespace blink |
OLD | NEW |