754271347a
Add new application, called GPU-CTS (GPU Compatibility Test Suite), which executes skia gms against OpenGL and Vulkan backends. Makes use of googletest library for consistancy with Android CTS programs. Add googletest to DEPS gm_knowledge.h header as a stub for future work on validating gm output. gm_runner can be re-used in other programs. Talks to Skia and GM with a simple API. gpuctx executable wraps gm_runner and googletest together. Change-Id: Ie7350b22164fa73e44121c39b0f36da4038a700b Reviewed-on: https://skia-review.googlesource.com/56601 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
58 lines
1.4 KiB
C
58 lines
1.4 KiB
C
/*
|
|
* Copyright 2017 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
#ifndef gm_knowledge_DEFINED
|
|
#define gm_knowledge_DEFINED
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
/**
|
|
A structure representing an image. pix should either be nullptr (representing
|
|
a missing image) or point to a block of memory width*height in size.
|
|
|
|
Each pixel is an un-pre-multiplied RGBA color:
|
|
void set_color(GMK_ImageData* data, int x, int y,
|
|
unsigned char r, unsigned char g, unsigned char b, unsigned char a) {
|
|
data->pix[x + data->width * y] = (r << 0) | (g << 8) | (b << 16) | (a << 24);
|
|
}
|
|
*/
|
|
typedef struct {
|
|
const uint32_t* pix;
|
|
int width;
|
|
int height;
|
|
} GMK_ImageData;
|
|
|
|
/**
|
|
Check if the given test image matches the expected results.
|
|
|
|
@param data the image
|
|
@param gm_name the name of the rendering test that produced the image
|
|
|
|
@return 0 if the test passes, otherwise a positive number representing how
|
|
badly it failed.
|
|
*/
|
|
float GMK_Check(GMK_ImageData data, const char* gm_name);
|
|
|
|
/**
|
|
Check to see if the given test has expected results.
|
|
|
|
@param gm_name the name of a rendering test.
|
|
|
|
@return true of expected results are known for the given test.
|
|
*/
|
|
bool GMK_IsGoodGM(const char* gm_name);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // gm_knowledge_DEFINED
|