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

Side by Side Diff: src/codec/SkBmpCodec.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 | « include/private/SkTemplates.h ('k') | src/codec/SkJpegCodec.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 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBmpCodec.h" 8 #include "SkBmpCodec.h"
9 #include "SkBmpMaskCodec.h" 9 #include "SkBmpMaskCodec.h"
10 #include "SkBmpRLECodec.h" 10 #include "SkBmpRLECodec.h"
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 kInfoV4_BmpHeaderType == headerType || 385 kInfoV4_BmpHeaderType == headerType ||
386 kInfoV5_BmpHeaderType == headerType) { 386 kInfoV5_BmpHeaderType == headerType) {
387 // Header types are matched based on size. If the header is 387 // Header types are matched based on size. If the header is
388 // V3+, we are guaranteed to be able to read at least this size. 388 // V3+, we are guaranteed to be able to read at least this size.
389 SkASSERT(infoBytesRemaining > 52); 389 SkASSERT(infoBytesRemaining > 52);
390 inputMasks.alpha = get_int(iBuffer.get(), 48); 390 inputMasks.alpha = get_int(iBuffer.get(), 48);
391 if (inputMasks.alpha != 0) { 391 if (inputMasks.alpha != 0) {
392 alphaType = kUnpremul_SkAlphaType; 392 alphaType = kUnpremul_SkAlphaType;
393 } 393 }
394 } 394 }
395 iBuffer.free(); 395 iBuffer.reset();
396 396
397 // Additionally, 32 bit bmp-in-icos use the alpha channel. 397 // Additionally, 32 bit bmp-in-icos use the alpha channel.
398 // FIXME (msarett): Don't all bmp-in-icos use the alpha channel? 398 // FIXME (msarett): Don't all bmp-in-icos use the alpha channel?
399 // And, RLE inputs may skip pixels, leaving them as transparent. This 399 // And, RLE inputs may skip pixels, leaving them as transparent. This
400 // is uncommon, but we cannot be certain that an RLE bmp will be opaque. 400 // is uncommon, but we cannot be certain that an RLE bmp will be opaque.
401 if ((inIco && 32 == bitsPerPixel) || (kRLE_BmpInputFormat == inputFormat)) { 401 if ((inIco && 32 == bitsPerPixel) || (kRLE_BmpInputFormat == inputFormat)) {
402 alphaType = kUnpremul_SkAlphaType; 402 alphaType = kUnpremul_SkAlphaType;
403 } 403 }
404 404
405 // Check for valid bits per pixel. 405 // Check for valid bits per pixel.
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 } 586 }
587 587
588 bool SkBmpCodec::skipRows(int count) { 588 bool SkBmpCodec::skipRows(int count) {
589 const size_t bytesToSkip = count * fSrcRowBytes; 589 const size_t bytesToSkip = count * fSrcRowBytes;
590 return this->stream()->skip(bytesToSkip) == bytesToSkip; 590 return this->stream()->skip(bytesToSkip) == bytesToSkip;
591 } 591 }
592 592
593 bool SkBmpCodec::onSkipScanlines(int count) { 593 bool SkBmpCodec::onSkipScanlines(int count) {
594 return this->skipRows(count); 594 return this->skipRows(count);
595 } 595 }
OLDNEW
« no previous file with comments | « include/private/SkTemplates.h ('k') | src/codec/SkJpegCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698