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

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

Issue 805543002: DM warning-free on win64 (Closed) Base URL: https://skia.googlesource.com/skia.git@w64
Patch Set: Created 6 years 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/Writer32Test.cpp ('k') | no next file » | 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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 493
494 // Calculate the key value data size 494 // Calculate the key value data size
495 hdr.fBytesOfKeyValueData = 0; 495 hdr.fBytesOfKeyValueData = 0;
496 for (KeyValue *kv = kvPairs.begin(); kv != kvPairs.end(); ++kv) { 496 for (KeyValue *kv = kvPairs.begin(); kv != kvPairs.end(); ++kv) {
497 // Key value size is the size of the key value data, 497 // Key value size is the size of the key value data,
498 // four bytes for saying how big the key value size is 498 // four bytes for saying how big the key value size is
499 // and then additional bytes for padding to four byte boundary 499 // and then additional bytes for padding to four byte boundary
500 size_t kvsize = kv->size(); 500 size_t kvsize = kv->size();
501 kvsize += 4; 501 kvsize += 4;
502 kvsize = (kvsize + 3) & ~3; 502 kvsize = (kvsize + 3) & ~3;
503 hdr.fBytesOfKeyValueData += kvsize; 503 hdr.fBytesOfKeyValueData = SkToU32(hdr.fBytesOfKeyValueData + kvsize);
504 } 504 }
505 505
506 // Write the header 506 // Write the header
507 if (!stream->write(&hdr, sizeof(hdr))) { 507 if (!stream->write(&hdr, sizeof(hdr))) {
508 return false; 508 return false;
509 } 509 }
510 510
511 // Write out each key value pair 511 // Write out each key value pair
512 for (KeyValue *kv = kvPairs.begin(); kv != kvPairs.end(); ++kv) { 512 for (KeyValue *kv = kvPairs.begin(); kv != kvPairs.end(); ++kv) {
513 if (!kv->writeKeyAndValueForKTX(stream)) { 513 if (!kv->writeKeyAndValueForKTX(stream)) {
(...skipping 36 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/Writer32Test.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698