Revert "Remove most of GrConfig.h"
This reverts commit 80e334dad832d1f29dfa361f1fbc113378466634.
Reason for revert: Chrome is including our private headers which means this breaks the Chrome roll:
https://chromium-review.googlesource.com/c/chromium/src/+/1953757
Original change's description:
> Remove most of GrConfig.h
>
> Change-Id: I0f693bed0778151f93d07cd42c6b597566695ab1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257999
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=egdaniel@google.com,bsalomon@google.com
Change-Id: Ie206db9865a7f9a7e334eb248de8cff38dd31d15
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258356
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrStyle.cpp b/src/gpu/GrStyle.cpp
index caf361b..305b5b3 100644
--- a/src/gpu/GrStyle.cpp
+++ b/src/gpu/GrStyle.cpp
@@ -9,7 +9,7 @@
#include "src/utils/SkDashPathPriv.h"
int GrStyle::KeySize(const GrStyle &style, Apply apply, uint32_t flags) {
- static_assert(sizeof(uint32_t) == sizeof(SkScalar));
+ GR_STATIC_ASSERT(sizeof(uint32_t) == sizeof(SkScalar));
int size = 0;
if (style.isDashed()) {
// One scalar for scale, one for dash phase, and one for each dash value.
@@ -34,7 +34,7 @@
uint32_t flags) {
SkASSERT(key);
SkASSERT(KeySize(style, apply) >= 0);
- static_assert(sizeof(uint32_t) == sizeof(SkScalar));
+ GR_STATIC_ASSERT(sizeof(uint32_t) == sizeof(SkScalar));
int i = 0;
// The scale can influence both the path effect and stroking. We want to preserve the
@@ -44,7 +44,7 @@
// from SkStrokeRec output by the the path effect (and no additional path effect).
// Since the scale can affect both parts of 2 we write it into the key twice.
if (style.isDashed()) {
- static_assert(sizeof(style.dashPhase()) == sizeof(uint32_t));
+ GR_STATIC_ASSERT(sizeof(style.dashPhase()) == sizeof(uint32_t));
SkScalar phase = style.dashPhase();
memcpy(&key[i++], &scale, sizeof(SkScalar));
memcpy(&key[i++], &phase, sizeof(SkScalar));
@@ -70,9 +70,9 @@
kJoinShift = kStyleBits,
kCapShift = kJoinShift + kJoinBits,
};
- static_assert(SkStrokeRec::kStyleCount <= (1 << kStyleBits));
- static_assert(SkPaint::kJoinCount <= (1 << kJoinBits));
- static_assert(SkPaint::kCapCount <= (1 << kCapBits));
+ GR_STATIC_ASSERT(SkStrokeRec::kStyleCount <= (1 << kStyleBits));
+ GR_STATIC_ASSERT(SkPaint::kJoinCount <= (1 << kJoinBits));
+ GR_STATIC_ASSERT(SkPaint::kCapCount <= (1 << kCapBits));
// The cap type only matters for unclosed shapes. However, a path effect could unclose
// the shape before it is stroked.
SkPaint::Cap cap = SkPaint::kDefault_Cap;