• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1  /*
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 "gm/gm.h"
9  #include "include/core/SkCanvas.h"
10  #include "include/core/SkImage.h"
11  #include "include/core/SkRefCnt.h"
12  #include "include/core/SkTypes.h"
13  #include "tools/Resources.h"
14  
15  /*
16   *  Test decoding grayscale JPEG
17   *  http://crbug.com/436079
18   */
19  DEF_SIMPLE_GM(grayscalejpg, canvas, 128, 128) {
20      const char kResource[] = "images/grayscale.jpg";
21      sk_sp<SkImage> image(GetResourceAsImage(kResource));
22      if (image) {
23          canvas->drawImage(image, 0.0f, 0.0f);
24      } else {
25          SkDebugf("\nCould not decode file '%s'. Did you forget"
26                   " to set the resourcePath?\n", kResource);
27      }
28  }
29