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

Side by Side Diff: tests/ImageDecodingTest.cpp

Issue 447343002: Revert of - 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
« no previous file with comments | « src/utils/SkTextureCompressor_ASTC.cpp ('k') | tests/TextureCompressionTest.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 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
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:
58 // KTX and ASTC are texture formats so it's not particularly clear how t o 58 // KTX is a Texture format so it's not particularly clear how to
59 // decode the alpha from them. 59 // decode the alpha from it.
60 case SkImageDecoder::kKTX_Format: 60 case SkImageDecoder::kKTX_Format:
61 case SkImageDecoder::kASTC_Format:
62 // The rest of these are opaque. 61 // The rest of these are opaque.
63 case SkImageDecoder::kPKM_Format: 62 case SkImageDecoder::kPKM_Format:
64 case SkImageDecoder::kWBMP_Format: 63 case SkImageDecoder::kWBMP_Format:
65 case SkImageDecoder::kGIF_Format: 64 case SkImageDecoder::kGIF_Format:
66 case SkImageDecoder::kJPEG_Format: 65 case SkImageDecoder::kJPEG_Format:
67 return true; 66 return true;
68 } 67 }
69 SkASSERT(false); 68 SkASSERT(false);
70 return true; 69 return true;
71 } 70 }
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 ((void*)pixels.get(), sizeof(uint16_t) * pixelCount))); 809 ((void*)pixels.get(), sizeof(uint16_t) * pixelCount)));
811 decoder->setAllocator(allocator); 810 decoder->setAllocator(allocator);
812 decoder->setSampleSize(2); 811 decoder->setSampleSize(2);
813 SkBitmap bitmap; 812 SkBitmap bitmap;
814 bool success = decoder->decode(stream, &bitmap, kRGB_565_SkColorType, 813 bool success = decoder->decode(stream, &bitmap, kRGB_565_SkColorType,
815 SkImageDecoder::kDecodePixels_Mode); 814 SkImageDecoder::kDecodePixels_Mode);
816 REPORTER_ASSERT(r, success); 815 REPORTER_ASSERT(r, success);
817 REPORTER_ASSERT(r, !allocator->ready()); // Decoder used correct memory 816 REPORTER_ASSERT(r, !allocator->ready()); // Decoder used correct memory
818 REPORTER_ASSERT(r, sentinal == pixels[pixelCount]); 817 REPORTER_ASSERT(r, sentinal == pixels[pixelCount]);
819 } 818 }
OLDNEW
« no previous file with comments | « src/utils/SkTextureCompressor_ASTC.cpp ('k') | tests/TextureCompressionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698