Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
gm
grayscalejpg.cpp
Go to the documentation of this file.
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/DecodeUtils.h
"
14
#include "
tools/Resources.h
"
15
16
/*
17
* Test decoding grayscale JPEG
18
* http://crbug.com/436079
19
*/
20
DEF_SIMPLE_GM
(grayscalejpg, canvas, 128, 128) {
21
const
char
kResource[] =
"images/grayscale.jpg"
;
22
sk_sp<SkImage>
image
(
ToolUtils::GetResourceAsImage
(kResource));
23
if
(
image
) {
24
canvas->drawImage(
image
, 0.0f, 0.0f);
25
}
else
{
26
SkDebugf
(
"\nCould not decode file '%s'. Did you forget"
27
" to set the resourcePath?\n"
, kResource);
28
}
29
}
DecodeUtils.h
Resources.h
SkCanvas.h
SkDebugf
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
SkImage.h
SkRefCnt.h
SkTypes.h
sk_sp
Definition
SkRefCnt.h:220
image
sk_sp< SkImage > image
Definition
examples.cpp:29
gm.h
DEF_SIMPLE_GM
#define DEF_SIMPLE_GM(NAME, CANVAS, W, H)
Definition
gm.h:50
ToolUtils::GetResourceAsImage
sk_sp< SkImage > GetResourceAsImage(const char *resource)
Definition
DecodeUtils.h:25
Generated on Fri Apr 26 2024 06:16:05 for Flutter Engine by
1.9.8