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

Side by Side Diff: src/pdf/SkPDFImage.cpp

Issue 47513017: More Windows 64b compilation warning fixes (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Fix linux & mac builds Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/pdf/SkPDFDeviceFlattener.cpp ('k') | src/utils/debugger/SkObjectParser.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 * 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 "SkPDFImage.h" 8 #include "SkPDFImage.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 return SkPackARGB4444(SK_AlphaOPAQUE & 0x0F, 419 return SkPackARGB4444(SK_AlphaOPAQUE & 0x0F,
420 r / count, g / count, b / count); 420 r / count, g / count, b / count);
421 } 421 }
422 } 422 }
423 423
424 static SkBitmap unpremultiply_bitmap(const SkBitmap& bitmap, 424 static SkBitmap unpremultiply_bitmap(const SkBitmap& bitmap,
425 const SkIRect& srcRect) { 425 const SkIRect& srcRect) {
426 SkBitmap outBitmap; 426 SkBitmap outBitmap;
427 outBitmap.setConfig(bitmap.config(), srcRect.width(), srcRect.height()); 427 outBitmap.setConfig(bitmap.config(), srcRect.width(), srcRect.height());
428 outBitmap.allocPixels(); 428 outBitmap.allocPixels();
429 size_t dstRow = 0; 429 int dstRow = 0;
430 430
431 outBitmap.lockPixels(); 431 outBitmap.lockPixels();
432 bitmap.lockPixels(); 432 bitmap.lockPixels();
433 switch (bitmap.config()) { 433 switch (bitmap.config()) {
434 case SkBitmap::kARGB_4444_Config: { 434 case SkBitmap::kARGB_4444_Config: {
435 for (int y = srcRect.fTop; y < srcRect.fBottom; y++) { 435 for (int y = srcRect.fTop; y < srcRect.fBottom; y++) {
436 uint16_t* dst = outBitmap.getAddr16(0, dstRow); 436 uint16_t* dst = outBitmap.getAddr16(0, dstRow);
437 uint16_t* src = bitmap.getAddr16(0, y); 437 uint16_t* src = bitmap.getAddr16(0, y);
438 for (int x = srcRect.fLeft; x < srcRect.fRight; x++) { 438 for (int x = srcRect.fLeft; x < srcRect.fRight; x++) {
439 uint8_t a = SkGetPackedA4444(src[x]); 439 uint8_t a = SkGetPackedA4444(src[x]);
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 // but the new catalog wants it compressed. 680 // but the new catalog wants it compressed.
681 if (!getSubstitute()) { 681 if (!getSubstitute()) {
682 SkPDFStream* substitute = SkNEW_ARGS(SkPDFImage, (*this)); 682 SkPDFStream* substitute = SkNEW_ARGS(SkPDFImage, (*this));
683 setSubstitute(substitute); 683 setSubstitute(substitute);
684 catalog->setSubstitute(this, substitute); 684 catalog->setSubstitute(this, substitute);
685 } 685 }
686 return false; 686 return false;
687 } 687 }
688 return true; 688 return true;
689 } 689 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDeviceFlattener.cpp ('k') | src/utils/debugger/SkObjectParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698