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

Side by Side Diff: src/images/SkImageDecoder_libwebp.cpp

Issue 1811723002: free -> reset (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: zarro boogs found Created 4 years, 9 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 | « src/gpu/text/GrBatchFontCache.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | 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 2010, The Android Open Source Project 2 * Copyright 2010, The Android Open Source Project
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at 6 * You may obtain a copy of the License at
7 * 7 *
8 * http://www.apache.org/licenses/LICENSE-2.0 8 * http://www.apache.org/licenses/LICENSE-2.0
9 * 9 *
10 * Unless required by applicable law or agreed to in writing, software 10 * Unless required by applicable law or agreed to in writing, software
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 success = false; 217 success = false;
218 break; 218 break;
219 } 219 }
220 220
221 status = WebPIAppend(idec, input, bytesRead); 221 status = WebPIAppend(idec, input, bytesRead);
222 if (VP8_STATUS_OK != status && VP8_STATUS_SUSPENDED != status) { 222 if (VP8_STATUS_OK != status && VP8_STATUS_SUSPENDED != status) {
223 success = false; 223 success = false;
224 break; 224 break;
225 } 225 }
226 } while (VP8_STATUS_OK != status); 226 } while (VP8_STATUS_OK != status);
227 srcStorage.free(); 227 srcStorage.reset();
228 WebPIDelete(idec); 228 WebPIDelete(idec);
229 WebPFreeDecBuffer(&config->output); 229 WebPFreeDecBuffer(&config->output);
230 230
231 return success; 231 return success;
232 } 232 }
233 233
234 static bool webp_get_config_resize(WebPDecoderConfig* config, 234 static bool webp_get_config_resize(WebPDecoderConfig* config,
235 SkBitmap* decodedBitmap, 235 SkBitmap* decodedBitmap,
236 int width, int height, bool premultiply) { 236 int width, int height, bool premultiply) {
237 WEBP_CSP_MODE mode = webp_decode_mode(decodedBitmap, premultiply); 237 WEBP_CSP_MODE mode = webp_decode_mode(decodedBitmap, premultiply);
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 return SkImageDecoder::kUnknown_Format; 550 return SkImageDecoder::kUnknown_Format;
551 } 551 }
552 552
553 static SkImageEncoder* sk_libwebp_efactory(SkImageEncoder::Type t) { 553 static SkImageEncoder* sk_libwebp_efactory(SkImageEncoder::Type t) {
554 return (SkImageEncoder::kWEBP_Type == t) ? new SkWEBPImageEncoder : nullptr; 554 return (SkImageEncoder::kWEBP_Type == t) ? new SkWEBPImageEncoder : nullptr;
555 } 555 }
556 556
557 static SkImageDecoder_DecodeReg gDReg(sk_libwebp_dfactory); 557 static SkImageDecoder_DecodeReg gDReg(sk_libwebp_dfactory);
558 static SkImageDecoder_FormatReg gFormatReg(get_format_webp); 558 static SkImageDecoder_FormatReg gFormatReg(get_format_webp);
559 static SkImageEncoder_EncodeReg gEReg(sk_libwebp_efactory); 559 static SkImageEncoder_EncodeReg gEReg(sk_libwebp_efactory);
OLDNEW
« no previous file with comments | « src/gpu/text/GrBatchFontCache.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698