blob: 851c8d0c7a5a6f33a949111bf3654e47b8ae2d8d [file] [log] [blame]
halcanaryd476a172014-12-02 06:37:21 -08001/*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "Resources.h"
halcanary2f0a7282015-08-21 07:47:23 -07009#include "SkImage.h"
halcanaryd476a172014-12-02 06:37:21 -080010#include "gm.h"
11
12/*
13 * Test decoding grayscale JPEG
14 * http://crbug.com/436079
15 */
16DEF_SIMPLE_GM(grayscalejpg, canvas, 128, 128) {
Hal Canaryc465d132017-12-08 10:21:31 -050017 const char kResource[] = "images/grayscale.jpg";
reed9ce9d672016-03-17 10:51:11 -070018 sk_sp<SkImage> image(GetResourceAsImage(kResource));
halcanary2f0a7282015-08-21 07:47:23 -070019 if (image) {
20 canvas->drawImage(image, 0.0f, 0.0f);
halcanaryd476a172014-12-02 06:37:21 -080021 } else {
22 SkDebugf("\nCould not decode file '%s'. Did you forget"
23 " to set the resourcePath?\n", kResource);
24 }
25}