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

Side by Side Diff: tests/ImageDecodingTest.cpp

Issue 444093002: - Add astcbitmap to gm slides (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 "Resources.h" 8 #include "Resources.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 static bool skip_image_format(SkImageDecoder::Format format) { 47 static bool skip_image_format(SkImageDecoder::Format format) {
48 switch (format) { 48 switch (format) {
49 case SkImageDecoder::kPNG_Format: 49 case SkImageDecoder::kPNG_Format:
50 case SkImageDecoder::kWEBP_Format: 50 case SkImageDecoder::kWEBP_Format:
51 return false; 51 return false;
52 // Skip unknown since it will not be decoded anyway. 52 // Skip unknown since it will not be decoded anyway.
53 case SkImageDecoder::kUnknown_Format: 53 case SkImageDecoder::kUnknown_Format:
54 // Technically ICO and BMP supports alpha channels, but our image 54 // Technically ICO and BMP supports alpha channels, but our image
55 // decoders do not, so skip them as well. 55 // decoders do not, so skip them as well.
56 case SkImageDecoder::kICO_Format: 56 case SkImageDecoder::kICO_Format:
57 case SkImageDecoder::kBMP_Format: 57 case SkImageDecoder::kBMP_Format:
robertphillips 2014/08/06 21:13:15 is -> are ? format -> formats ?
krajcevski 2014/08/06 22:31:00 Done.
58 // KTX is a Texture format so it's not particularly clear how to 58 // KTX and ASTC is a Texture format so it's not particularly clear how t o
59 // decode the alpha from it. 59 // decode the alpha from it.
60 case SkImageDecoder::kKTX_Format: 60 case SkImageDecoder::kKTX_Format:
61 case SkImageDecoder::kASTC_Format:
61 // The rest of these are opaque. 62 // The rest of these are opaque.
62 case SkImageDecoder::kPKM_Format: 63 case SkImageDecoder::kPKM_Format:
63 case SkImageDecoder::kWBMP_Format: 64 case SkImageDecoder::kWBMP_Format:
64 case SkImageDecoder::kGIF_Format: 65 case SkImageDecoder::kGIF_Format:
65 case SkImageDecoder::kJPEG_Format: 66 case SkImageDecoder::kJPEG_Format:
66 return true; 67 return true;
67 } 68 }
68 SkASSERT(false); 69 SkASSERT(false);
69 return true; 70 return true;
70 } 71 }
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 ((void*)pixels.get(), sizeof(uint16_t) * pixelCount))); 810 ((void*)pixels.get(), sizeof(uint16_t) * pixelCount)));
810 decoder->setAllocator(allocator); 811 decoder->setAllocator(allocator);
811 decoder->setSampleSize(2); 812 decoder->setSampleSize(2);
812 SkBitmap bitmap; 813 SkBitmap bitmap;
813 bool success = decoder->decode(stream, &bitmap, kRGB_565_SkColorType, 814 bool success = decoder->decode(stream, &bitmap, kRGB_565_SkColorType,
814 SkImageDecoder::kDecodePixels_Mode); 815 SkImageDecoder::kDecodePixels_Mode);
815 REPORTER_ASSERT(r, success); 816 REPORTER_ASSERT(r, success);
816 REPORTER_ASSERT(r, !allocator->ready()); // Decoder used correct memory 817 REPORTER_ASSERT(r, !allocator->ready()); // Decoder used correct memory
817 REPORTER_ASSERT(r, sentinal == pixels[pixelCount]); 818 REPORTER_ASSERT(r, sentinal == pixels[pixelCount]);
818 } 819 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698