aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2016-10-28 10:38:08 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-10-28 15:20:26 +0000
commitb6c5e5379605627fb2bdb49b62141291fca20824 (patch)
tree4d206ace5e0816399a224810cfb4c1340994c0e9
parent187a771f594a3b96caad7f6f15827874d3308ef5 (diff)
Add SampleApp support to GN (win and linux), take two.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4075 Change-Id: I2b25c3e48992e63d2990c8ac77363eff4ddd926d Reviewed-on: https://skia-review.googlesource.com/4075 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
-rw-r--r--BUILD.gn40
-rw-r--r--samplecode/SampleApp.cpp7
2 files changed, 39 insertions, 8 deletions
diff --git a/BUILD.gn b/BUILD.gn
index 6a559227a3..7f0d16e7b7 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -106,7 +106,10 @@ config("skia_private") {
"third_party/ktx",
]
- defines = [ "SK_GAMMA_APPLY_TO_A8" ]
+ defines = [
+ "SK_GAMMA_APPLY_TO_A8",
+ "SK_INTERNAL",
+ ]
if (is_android) {
defines += [
"SK_GAMMA_EXPONENT=1.4",
@@ -989,19 +992,48 @@ if (skia_enable_tools) {
testonly = true
}
- if (skia_enable_gpu) {
- executable("skpbench") {
+ if (is_linux || is_win) {
+ executable("SampleApp") {
sources = [
- "tools/skpbench/skpbench.cpp",
+ "samplecode/SampleApp.cpp",
+ "samplecode/SamplePictFile.cpp",
]
+ if (is_mac) {
+ sources += [ "src/views/mac/skia_mac.mm" ]
+ } else if (is_win) {
+ sources += [ "src/views/win/skia_win.cpp" ]
+ } else if (is_linux) {
+ sources += [ "src/views/unix/skia_unix.cpp" ]
+ }
deps = [
":flags",
+ ":gm",
":gpu_tool_utils",
+ ":samples",
":skia",
":tool_utils",
+ ":views",
]
+ if (skia_use_angle) {
+ deps += [ "//third_party/angle2" ]
+ }
testonly = true
}
+
+ if (skia_enable_gpu) {
+ executable("skpbench") {
+ sources = [
+ "tools/skpbench/skpbench.cpp",
+ ]
+ deps = [
+ ":flags",
+ ":gpu_tool_utils",
+ ":skia",
+ ":tool_utils",
+ ]
+ testonly = true
+ }
+ }
}
# We can't yet build ICU on Windows.
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 20a1969d88..6f0e95842e 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -730,9 +730,8 @@ DEFINE_string(svgDir, "", "Read SVGs from here.");
DEFINE_string(sequence, "", "Path to file containing the desired samples/gms to show.");
DEFINE_bool(sort, false, "Sort samples by title.");
DEFINE_bool(list, false, "List samples?");
-DEFINE_bool(gpu, false, "Start up with gpu?");
+DEFINE_bool(startgpu, false, "Start up with gpu?");
DEFINE_bool(redraw, false, "Force continuous redrawing, for profiling or debugging tools.");
-DEFINE_string(key, "", ""); // dummy to enable gm tests that have platform-specific names
#ifdef SAMPLE_PDF_FILE_VIEWER
DEFINE_string(pdfPath, "", "Path to direcotry of pdf files.");
#endif
@@ -852,7 +851,7 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev
fDeviceType = kRaster_DeviceType;
#if SK_SUPPORT_GPU
- if (FLAGS_gpu) {
+ if (FLAGS_startgpu) {
fDeviceType = kGPU_DeviceType;
}
#endif
@@ -1614,7 +1613,7 @@ static sk_sp<SkColorSpace> getMonitorColorSpace() {
if (dc) {
char icmPath[MAX_PATH + 1];
DWORD pathLength = MAX_PATH;
- BOOL success = GetICMProfile(dc, &pathLength, icmPath);
+ BOOL success = GetICMProfileA(dc, &pathLength, icmPath);
DeleteDC(dc);
if (success) {
sk_sp<SkData> iccData = SkData::MakeFromFileName(icmPath);