aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/mtl/GrMtlGpu.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-02-20 14:05:36 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-20 19:30:13 +0000
commitc320b1576850745a1011ada0bcef3de5f9b9f649 (patch)
tree125778e9a92ac1deed777367921475fafa45ada2 /src/gpu/mtl/GrMtlGpu.h
parentadb4fcbbfdbf8ab6a76c1115073f3ddec5a8f3ca (diff)
Introduce GrColorType
This begins the journey towards using different types to refer to CPU data and GPU texture formats. This is one part of removing GrPixelConfig and more directly using GL/VK texture formats GrColorType represents a particular layout of color/gray/alpha channels in CPU memory. It does not refer to texture formats or sRGB-encoding. It is basically SkColorType specialized to the GPU backend with some formats added and some removed. Read/WritePixel interfaces use GrColorType to describe the CPU side of the transaction. There's still a lot of punting to GrPixelConfig in API-specific code. There's a lot more to be done. Bug: 6718 Bug: 7580 Change-Id: I8d813ae9a4416a06596f22a4b87da02091989718 Reviewed-on: https://skia-review.googlesource.com/107264 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/mtl/GrMtlGpu.h')
-rw-r--r--src/gpu/mtl/GrMtlGpu.h36
1 files changed, 17 insertions, 19 deletions
diff --git a/src/gpu/mtl/GrMtlGpu.h b/src/gpu/mtl/GrMtlGpu.h
index 748a527a7b..9482d9591a 100644
--- a/src/gpu/mtl/GrMtlGpu.h
+++ b/src/gpu/mtl/GrMtlGpu.h
@@ -31,15 +31,17 @@ public:
id<MTLDevice> device() const { return fDevice; }
- bool onGetReadPixelsInfo(GrSurface* srcSurface, GrSurfaceOrigin origin,
- int readWidth, int readHeight, size_t rowBytes,
- GrPixelConfig readConfig, DrawPreference*,
- ReadPixelTempDrawInfo*) override { return false; }
+ bool onGetReadPixelsInfo(GrSurface* srcSurface, GrSurfaceOrigin origin, int readWidth,
+ int readHeight, size_t rowBytes, GrColorType readConfig,
+ DrawPreference*, ReadPixelTempDrawInfo*) override {
+ return false;
+ }
- bool onGetWritePixelsInfo(GrSurface* dstSurface, GrSurfaceOrigin dstOrigin,
- int width, int height,
- GrPixelConfig srcConfig, DrawPreference*,
- WritePixelTempDrawInfo*) override { return false; }
+ bool onGetWritePixelsInfo(GrSurface* dstSurface, GrSurfaceOrigin dstOrigin, int width,
+ int height, GrColorType srcColorType, DrawPreference*,
+ WritePixelTempDrawInfo*) override {
+ return false;
+ }
bool onCopySurface(GrSurface* dst, GrSurfaceOrigin dstOrigin,
GrSurface* src, GrSurfaceOrigin srcOrigin,
@@ -105,24 +107,20 @@ private:
return nullptr;
}
- bool onReadPixels(GrSurface* surface, GrSurfaceOrigin,
- int left, int top, int width, int height,
- GrPixelConfig,
- void* buffer,
- size_t rowBytes) override {
+ bool onReadPixels(GrSurface* surface, GrSurfaceOrigin, int left, int top, int width, int height,
+ GrColorType, void* buffer, size_t rowBytes) override {
return false;
}
- bool onWritePixels(GrSurface* surface, GrSurfaceOrigin,
- int left, int top, int width, int height,
- GrPixelConfig config,
- const GrMipLevel texels[], int mipLevelCount) override {
+ bool onWritePixels(GrSurface*, GrSurfaceOrigin, int left, int top, int width,
+ int height, GrColorType, const GrMipLevel[],
+ int) override {
return false;
}
- bool onTransferPixels(GrTexture* texture,
+ bool onTransferPixels(GrTexture*,
int left, int top, int width, int height,
- GrPixelConfig config, GrBuffer* transferBuffer,
+ GrColorType, GrBuffer*,
size_t offset, size_t rowBytes) override {
return false;
}