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>
This commit is contained in:
Brian Salomon 2018-03-23 16:32:22 -04:00 committed by Skia Commit-Bot
parent 49edccd775
commit a6a3df7d64
6 changed files with 52 additions and 48 deletions

View File

@ -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

View File

@ -27,6 +27,52 @@ using GrStdSteadyClock = std::chrono::monotonic_clock;
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.
*/

View File

@ -13,7 +13,7 @@
#include "SkSurfaceProps.h"
#if SK_SUPPORT_GPU
#include "GrTypes.h"
#include "GrTypesPriv.h"
#endif
class GrContext;

View File

@ -11,6 +11,7 @@
#include "gl/GrGLInterface.h"
#include "GrGLDefines.h"
#include "GrStencilSettings.h"
#include "GrTypesPriv.h"
class SkMatrix;

View File

@ -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
*/

View File

@ -8,6 +8,7 @@
#ifndef SkSurface_Gpu_DEFINED
#define SkSurface_Gpu_DEFINED
#include "GrTypesPriv.h"
#include "SkSurface_Base.h"
#if SK_SUPPORT_GPU