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

Side by Side Diff: third_party/ktx/ktx.cpp

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 years, 3 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 | « tests/TextureCompressionTest.cpp ('k') | tools/PictureBenchmark.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 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "ktx.h" 9 #include "ktx.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 size_t bytesWrittenPadFour = (bytesWritten + 3) & ~3; 128 size_t bytesWrittenPadFour = (bytesWritten + 3) & ~3;
129 uint8_t nullBuf[4] = { 0, 0, 0, 0 }; 129 uint8_t nullBuf[4] = { 0, 0, 0, 0 };
130 130
131 size_t padding = bytesWrittenPadFour - bytesWritten; 131 size_t padding = bytesWrittenPadFour - bytesWritten;
132 SkASSERT(padding < 4); 132 SkASSERT(padding < 4);
133 133
134 return strm->write(nullBuf, padding); 134 return strm->write(nullBuf, padding);
135 } 135 }
136 136
137 uint32_t SkKTXFile::readInt(const uint8_t** buf, size_t* bytesLeft) const { 137 uint32_t SkKTXFile::readInt(const uint8_t** buf, size_t* bytesLeft) const {
138 SkASSERT(NULL != buf && NULL != bytesLeft); 138 SkASSERT(buf && bytesLeft);
139 139
140 uint32_t result; 140 uint32_t result;
141 141
142 if (*bytesLeft < 4) { 142 if (*bytesLeft < 4) {
143 SkASSERT(false); 143 SkASSERT(false);
144 return 0; 144 return 0;
145 } 145 }
146 146
147 memcpy(&result, *buf, 4); 147 memcpy(&result, *buf, 4);
148 *buf += 4; 148 *buf += 4;
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 for (int i = 0; i < height; ++i) { 550 for (int i = 0; i < height; ++i) {
551 if (!stream->write(rowPtr, bpp*width)) { 551 if (!stream->write(rowPtr, bpp*width)) {
552 return false; 552 return false;
553 } 553 }
554 rowPtr += bitmap.rowBytes(); 554 rowPtr += bitmap.rowBytes();
555 } 555 }
556 } 556 }
557 557
558 return true; 558 return true;
559 } 559 }
OLDNEW
« no previous file with comments | « tests/TextureCompressionTest.cpp ('k') | tools/PictureBenchmark.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698