2014-12-02 14:37:21 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2014 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "Resources.h"
|
2015-08-21 14:47:23 +00:00
|
|
|
#include "SkImage.h"
|
2014-12-02 14:37:21 +00:00
|
|
|
#include "gm.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Test decoding grayscale JPEG
|
|
|
|
* http://crbug.com/436079
|
|
|
|
*/
|
|
|
|
DEF_SIMPLE_GM(grayscalejpg, canvas, 128, 128) {
|
|
|
|
const char kResource[] = "grayscale.jpg";
|
2015-08-21 14:47:23 +00:00
|
|
|
SkAutoTUnref<SkImage> image(GetResourceAsImage(kResource));
|
|
|
|
if (image) {
|
|
|
|
canvas->drawImage(image, 0.0f, 0.0f);
|
2014-12-02 14:37:21 +00:00
|
|
|
} else {
|
|
|
|
SkDebugf("\nCould not decode file '%s'. Did you forget"
|
|
|
|
" to set the resourcePath?\n", kResource);
|
|
|
|
}
|
|
|
|
}
|