diff options
author | reed <reed@google.com> | 2014-12-19 12:26:07 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-19 12:26:07 -0800 |
commit | 53b9e2e0f29e5613f8d8d0eeb4a4b4d4a8a40e91 (patch) | |
tree | 1f1de908564f89cfc385d6d42433056c9d12bb78 /tools | |
parent | 7e38d99d03a4c4d52375b5a5a6ef337166150463 (diff) |
add const to encodePixels pixel parameter
BUG=skia:
Review URL: https://codereview.chromium.org/788143007
Diffstat (limited to 'tools')
-rw-r--r-- | tools/PictureRenderer.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/tools/PictureRenderer.cpp b/tools/PictureRenderer.cpp index 123cc2c5cc..5af0538a0d 100644 --- a/tools/PictureRenderer.cpp +++ b/tools/PictureRenderer.cpp @@ -366,14 +366,10 @@ SkCanvas* RecordPictureRenderer::setupCanvas(int width, int height) { class PngPixelSerializer : public SkPixelSerializer { public: - virtual bool onUseEncodedData(const void*, size_t) SK_OVERRIDE { return true; } - virtual SkData* onEncodePixels(const SkImageInfo& info, void* pixels, - size_t rowBytes) SK_OVERRIDE { - SkBitmap bm; - if (!bm.installPixels(info, pixels, rowBytes)) { - return NULL; - } - return SkImageEncoder::EncodeData(bm, SkImageEncoder::kPNG_Type, 100); + bool onUseEncodedData(const void*, size_t) SK_OVERRIDE { return true; } + SkData* onEncodePixels(const SkImageInfo& info, const void* pixels, + size_t rowBytes) SK_OVERRIDE { + return SkImageEncoder::EncodeData(info, pixels, rowBytes, SkImageEncoder::kPNG_Type, 100); } }; |