| 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 23 matching lines...) Expand all Loading... |
| 34 #include "platform/geometry/IntSize.h" | 34 #include "platform/geometry/IntSize.h" |
| 35 #include "platform/graphics/ImageBuffer.h" | 35 #include "platform/graphics/ImageBuffer.h" |
| 36 #include "platform/graphics/LoggingCanvas.h" | 36 #include "platform/graphics/LoggingCanvas.h" |
| 37 #include "platform/graphics/ProfilingCanvas.h" | 37 #include "platform/graphics/ProfilingCanvas.h" |
| 38 #include "platform/graphics/ReplayingCanvas.h" | 38 #include "platform/graphics/ReplayingCanvas.h" |
| 39 #include "platform/graphics/skia/ImagePixelLocker.h" | 39 #include "platform/graphics/skia/ImagePixelLocker.h" |
| 40 #include "platform/image-decoders/ImageDecoder.h" | 40 #include "platform/image-decoders/ImageDecoder.h" |
| 41 #include "platform/image-decoders/ImageFrame.h" | 41 #include "platform/image-decoders/ImageFrame.h" |
| 42 #include "platform/image-decoders/SegmentReader.h" | 42 #include "platform/image-decoders/SegmentReader.h" |
| 43 #include "platform/image-encoders/PNGImageEncoder.h" | 43 #include "platform/image-encoders/PNGImageEncoder.h" |
| 44 #include "platform/wtf/CurrentTime.h" |
| 45 #include "platform/wtf/HexNumber.h" |
| 46 #include "platform/wtf/PtrUtil.h" |
| 47 #include "platform/wtf/text/Base64.h" |
| 48 #include "platform/wtf/text/TextEncoding.h" |
| 44 #include "third_party/skia/include/core/SkData.h" | 49 #include "third_party/skia/include/core/SkData.h" |
| 45 #include "third_party/skia/include/core/SkImage.h" | 50 #include "third_party/skia/include/core/SkImage.h" |
| 46 #include "third_party/skia/include/core/SkImageDeserializer.h" | 51 #include "third_party/skia/include/core/SkImageDeserializer.h" |
| 47 #include "third_party/skia/include/core/SkPictureRecorder.h" | 52 #include "third_party/skia/include/core/SkPictureRecorder.h" |
| 48 #include "third_party/skia/include/core/SkStream.h" | 53 #include "third_party/skia/include/core/SkStream.h" |
| 49 #include "wtf/CurrentTime.h" | |
| 50 #include "wtf/HexNumber.h" | |
| 51 #include "wtf/PtrUtil.h" | |
| 52 #include "wtf/text/Base64.h" | |
| 53 #include "wtf/text/TextEncoding.h" | |
| 54 | 54 |
| 55 namespace blink { | 55 namespace blink { |
| 56 | 56 |
| 57 PictureSnapshot::PictureSnapshot(sk_sp<const SkPicture> picture) | 57 PictureSnapshot::PictureSnapshot(sk_sp<const SkPicture> picture) |
| 58 : m_picture(std::move(picture)) {} | 58 : m_picture(std::move(picture)) {} |
| 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, |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |