Commit f7ad5fd6 authored by Linshizhi's avatar Linshizhi

Add GPU render examples.

parent 79a0d920
cc_binary(
name = "skia_svg_render",
srcs = ["skia_svg_render.cc"],
copts = ["-I./src", "-std=c++2a"],
linkopts = [
"-lz", "-llzma", "-ljpeg", "-lfreetype",
"-lpng", "-lfontconfig", "-lGLX", "-lexpat -lm"],
deps = [
"@skia//:skia_svg",
"@skia//:skia",
],
)
cc_binary(
name = "skia_svg_gpu_render",
srcs = ["skia_svg_gpu_render.cc"],
copts = ["-std=c++2a"],
linkopts = [
"-lz",
"-llzma",
"-ljpeg",
"-lfreetype",
"-lpng",
"-lfontconfig",
"-lGLX",
"-lexpat",
"-lm"],
deps = [
"@skia//:skia_svg",
"@skia//:skia",
],
)
#include "include/gpu/GrBackendSurface.h"
#include "include/gpu/gl/GrGLTypes.h"
#include "include/gpu/GrDirectContext.h"
int main(void) {
const int width = 1920;
const int height = 1080;
const int pixelBytes = 4;
sk_sp<GrDirectContext> context = GrDirectContext::MakeGL();
return 0;
}
......@@ -12,8 +12,9 @@
#include "include/core/SkImage.h"
#include "include/core/SkEncodedImageFormat.h"
#include "include/core/SkData.h"
#include "include/gpu/gl/GrGLTypes.h"
int example(void) {
int main(void) {
const int width = 1920;
const int height = 1080;
const int pixelBytes = 4;
......
......@@ -34,6 +34,9 @@ COMPILE_ARGS=(
skia_enable_svg=true
skia_use_system_libwebp=false
skia_use_system_icu=false
skia_use_gl=true
skia_enable_gpu=true
)
printf -v COMPILE_ARGS_STR '%s ' "${COMPILE_ARGS[@]}"
......
int example();
#include "src/try.h"
#include "gtest/gtest.h"
extern "C" {
#include "external/theft/inc/theft.h"
}
// Tests factorial of 0.
TEST(Say, SayNothing) {
EXPECT_EQ(example(), 0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment