aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-03-23 16:32:22 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-23 21:05:10 +0000
commita6a3df7d64dc81082619ab103450fc6d0af7c644 (patch)
tree2784182d0508c2535926c9414e8159c0b7f6e458
parent49edccd775a38d93701ae376df28463d7848fd16 (diff)
Move GrPixelConfig to GrTypesPriv
BUG= skia:6718 Change-Id: I254a5d289c1216e580b8f7fe613236c090d0e901 Reviewed-on: https://skia-review.googlesource.com/116196 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
-rw-r--r--include/gpu/GrTypes.h45
-rw-r--r--include/private/GrTypesPriv.h46
-rw-r--r--src/core/SkSpecialSurface.h2
-rw-r--r--src/gpu/gl/GrGLUtil.h1
-rw-r--r--src/gpu/mtl/GrMtlUtil.h5
-rw-r--r--src/image/SkSurface_Gpu.h1
6 files changed, 52 insertions, 48 deletions
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index 7cb4abbab5..e21bb2c13a 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -215,51 +215,6 @@ enum class GrMipMapped : bool {
///////////////////////////////////////////////////////////////////////////////
-/**
- * Pixel configurations. This type conflates texture formats, CPU pixel formats, and
- * premultipliedness. We are moving away from it towards SkColorType and backend API (GL, Vulkan)
- * texture formats in the pulbic API. Right now this mostly refers to texture formats as we're
- * migrating.
- */
-enum GrPixelConfig {
- kUnknown_GrPixelConfig,
- kAlpha_8_GrPixelConfig,
- kGray_8_GrPixelConfig,
- kRGB_565_GrPixelConfig,
- kRGBA_4444_GrPixelConfig,
- kRGBA_8888_GrPixelConfig,
- kRGB_888_GrPixelConfig,
- kBGRA_8888_GrPixelConfig,
- kSRGBA_8888_GrPixelConfig,
- kSBGRA_8888_GrPixelConfig,
- kRGBA_1010102_GrPixelConfig,
- kRGBA_float_GrPixelConfig,
- kRG_float_GrPixelConfig,
- kAlpha_half_GrPixelConfig,
- kRGBA_half_GrPixelConfig,
-
- /** For internal usage. */
- kPrivateConfig1_GrPixelConfig,
- kPrivateConfig2_GrPixelConfig,
- kPrivateConfig3_GrPixelConfig,
- kPrivateConfig4_GrPixelConfig,
- kPrivateConfig5_GrPixelConfig,
-
- kLast_GrPixelConfig = kPrivateConfig5_GrPixelConfig
-};
-static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
-
-// Aliases for pixel configs that match skia's byte order.
-#ifndef SK_CPU_LENDIAN
- #error "Skia gpu currently assumes little endian"
-#endif
-#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
- static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
-#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
- static const GrPixelConfig kSkia8888_GrPixelConfig = kRGBA_8888_GrPixelConfig;
-#else
- #error "SK_*32_SHIFT values must correspond to GL_BGRA or GL_RGBA format."
-#endif
/**
* Opaque type for 3D API object handles. We are moving away from this type and towards type-safe
diff --git a/include/private/GrTypesPriv.h b/include/private/GrTypesPriv.h
index 0c43b783e0..8cabb94f35 100644
--- a/include/private/GrTypesPriv.h
+++ b/include/private/GrTypesPriv.h
@@ -28,6 +28,52 @@ using GrStdSteadyClock = std::chrono::steady_clock;
#endif
/**
+ * Pixel configurations. This type conflates texture formats, CPU pixel formats, and
+ * premultipliedness. We are moving away from it towards SkColorType and backend API (GL, Vulkan)
+ * texture formats in the pulbic API. Right now this mostly refers to texture formats as we're
+ * migrating.
+ */
+enum GrPixelConfig {
+ kUnknown_GrPixelConfig,
+ kAlpha_8_GrPixelConfig,
+ kGray_8_GrPixelConfig,
+ kRGB_565_GrPixelConfig,
+ kRGBA_4444_GrPixelConfig,
+ kRGBA_8888_GrPixelConfig,
+ kRGB_888_GrPixelConfig,
+ kBGRA_8888_GrPixelConfig,
+ kSRGBA_8888_GrPixelConfig,
+ kSBGRA_8888_GrPixelConfig,
+ kRGBA_1010102_GrPixelConfig,
+ kRGBA_float_GrPixelConfig,
+ kRG_float_GrPixelConfig,
+ kAlpha_half_GrPixelConfig,
+ kRGBA_half_GrPixelConfig,
+
+ /** For internal usage. */
+ kPrivateConfig1_GrPixelConfig,
+ kPrivateConfig2_GrPixelConfig,
+ kPrivateConfig3_GrPixelConfig,
+ kPrivateConfig4_GrPixelConfig,
+ kPrivateConfig5_GrPixelConfig,
+
+ kLast_GrPixelConfig = kPrivateConfig5_GrPixelConfig
+};
+static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
+
+// Aliases for pixel configs that match skia's byte order.
+#ifndef SK_CPU_LENDIAN
+#error "Skia gpu currently assumes little endian"
+#endif
+#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
+static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
+#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
+static const GrPixelConfig kSkia8888_GrPixelConfig = kRGBA_8888_GrPixelConfig;
+#else
+ #error "SK_*32_SHIFT values must correspond to GL_BGRA or GL_RGBA format."
+#endif
+
+/**
* Geometric primitives used for drawing.
*/
enum class GrPrimitiveType {
diff --git a/src/core/SkSpecialSurface.h b/src/core/SkSpecialSurface.h
index 96b74a4dac..2c138a3e79 100644
--- a/src/core/SkSpecialSurface.h
+++ b/src/core/SkSpecialSurface.h
@@ -13,7 +13,7 @@
#include "SkSurfaceProps.h"
#if SK_SUPPORT_GPU
-#include "GrTypes.h"
+#include "GrTypesPriv.h"
#endif
class GrContext;
diff --git a/src/gpu/gl/GrGLUtil.h b/src/gpu/gl/GrGLUtil.h
index 416538a749..8062a0dbce 100644
--- a/src/gpu/gl/GrGLUtil.h
+++ b/src/gpu/gl/GrGLUtil.h
@@ -11,6 +11,7 @@
#include "gl/GrGLInterface.h"
#include "GrGLDefines.h"
#include "GrStencilSettings.h"
+#include "GrTypesPriv.h"
class SkMatrix;
diff --git a/src/gpu/mtl/GrMtlUtil.h b/src/gpu/mtl/GrMtlUtil.h
index a84a636511..1900c3933d 100644
--- a/src/gpu/mtl/GrMtlUtil.h
+++ b/src/gpu/mtl/GrMtlUtil.h
@@ -8,10 +8,11 @@
#ifndef GrMtlUtil_DEFINED
#define GrMtlUtil_DEFINED
-#include "GrTypes.h"
-
#import <Metal/Metal.h>
+#include "GrTypesPriv.h"
+
+
/**
* Returns the Metal texture format for the given GrPixelConfig
*/
diff --git a/src/image/SkSurface_Gpu.h b/src/image/SkSurface_Gpu.h
index 9699b01e05..3edb0ca32f 100644
--- a/src/image/SkSurface_Gpu.h
+++ b/src/image/SkSurface_Gpu.h
@@ -8,6 +8,7 @@
#ifndef SkSurface_Gpu_DEFINED
#define SkSurface_Gpu_DEFINED
+#include "GrTypesPriv.h"
#include "SkSurface_Base.h"
#if SK_SUPPORT_GPU