7c0998a130
This reverts commit 880b9d302f
.
Reason for revert: Appears to be breaking serialization.
See https://ci.chromium.org/raw/build/logs.chromium.org/skia/20180718T201711.486335899Z_000000000077bbff/+/annotations
Original change's description:
> Add kAAHairline to GpuPathRenderers
>
> With the upcoming ccpr stroking, this will no longer be the only path
> renderer that can handle hairlines.
>
> Bug: skia:
> Change-Id: Idf2543f053c8603c80fcd647ca18ffd9860a85f3
> Reviewed-on: https://skia-review.googlesource.com/142246
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=brianosman@google.com,csmartdalton@google.com
Change-Id: I1967c2cf6b1f1307270bf62bb04130cdf84317b7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/142280
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
69 lines
2.2 KiB
C
69 lines
2.2 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 SK_COMMON_FLAGS_GPU_H
|
|
#define SK_COMMON_FLAGS_GPU_H
|
|
|
|
#include "GrTypesPriv.h"
|
|
#include "SkCommandLineFlags.h"
|
|
#include "SkTypes.h"
|
|
|
|
DECLARE_int32(gpuThreads);
|
|
DECLARE_bool(cachePathMasks);
|
|
DECLARE_bool(noGS);
|
|
DECLARE_string(pr);
|
|
|
|
inline GpuPathRenderers get_named_pathrenderers_flags(const char* name) {
|
|
if (!strcmp(name, "all")) {
|
|
return GpuPathRenderers::kAll;
|
|
} else if (!strcmp(name, "default")) {
|
|
return GpuPathRenderers::kDefault;
|
|
} else if (!strcmp(name, "dashline")) {
|
|
return GpuPathRenderers::kDashLine;
|
|
} else if (!strcmp(name, "nvpr")) {
|
|
return GpuPathRenderers::kStencilAndCover;
|
|
} else if (!strcmp(name, "aaconvex")) {
|
|
return GpuPathRenderers::kAAConvex;
|
|
} else if (!strcmp(name, "aalinearizing")) {
|
|
return GpuPathRenderers::kAALinearizing;
|
|
} else if (!strcmp(name, "small")) {
|
|
return GpuPathRenderers::kSmall;
|
|
} else if (!strcmp(name, "ccpr")) {
|
|
return GpuPathRenderers::kCoverageCounting;
|
|
} else if (!strcmp(name, "tess")) {
|
|
return GpuPathRenderers::kTessellating;
|
|
} else if (!strcmp(name, "none")) {
|
|
return GpuPathRenderers::kNone;
|
|
}
|
|
SK_ABORT(SkStringPrintf("error: unknown named path renderer \"%s\"\n", name).c_str());
|
|
return GpuPathRenderers::kNone;
|
|
}
|
|
|
|
inline GpuPathRenderers CollectGpuPathRenderersFromFlags() {
|
|
if (FLAGS_pr.isEmpty()) {
|
|
return GpuPathRenderers::kDefault;
|
|
}
|
|
GpuPathRenderers gpuPathRenderers = '~' == FLAGS_pr[0][0] ?
|
|
GpuPathRenderers::kDefault : GpuPathRenderers::kNone;
|
|
for (int i = 0; i < FLAGS_pr.count(); ++i) {
|
|
const char* name = FLAGS_pr[i];
|
|
if (name[0] == '~') {
|
|
gpuPathRenderers &= ~get_named_pathrenderers_flags(&name[1]);
|
|
} else {
|
|
gpuPathRenderers |= get_named_pathrenderers_flags(name);
|
|
}
|
|
}
|
|
return gpuPathRenderers;
|
|
}
|
|
|
|
/**
|
|
* Helper to set GrContextOptions from common GPU flags.
|
|
*/
|
|
void SetCtxOptionsFromCommonFlags(struct GrContextOptions*);
|
|
|
|
#endif
|