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) {
|
2017-12-08 15:21:31 +00:00
|
|
|
const char kResource[] = "images/grayscale.jpg";
|
2016-03-17 17:51:11 +00:00
|
|
|
sk_sp<SkImage> image(GetResourceAsImage(kResource));
|
2015-08-21 14:47:23 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|