diff options
author | Brian Salomon <bsalomon@google.com> | 2018-05-11 10:14:21 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-11 14:47:27 +0000 |
commit | c7fe0f708ccbf12bf2ad1374ff307940d2c93880 (patch) | |
tree | cc4e63c994ac6af6ddab2f0fa063dbf800e2dd8a /src/image/SkImage_Gpu.cpp | |
parent | 244f754cdd6ba1c5917a65cd94fe0bf87e3a7339 (diff) |
Make GrCaps and GrShaderCaps private.
Moves getCaps() from GrContext to GrContextPriv and removes unused refCaps().
Change-Id: Ic6a8951b656c0d1b2773eae73bff8e88af819866
Reviewed-on: https://skia-review.googlesource.com/127389
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/image/SkImage_Gpu.cpp')
-rw-r--r-- | src/image/SkImage_Gpu.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp index 17a0a25f5a..62b97ae131 100644 --- a/src/image/SkImage_Gpu.cpp +++ b/src/image/SkImage_Gpu.cpp @@ -374,7 +374,7 @@ bool validate_backend_texture(GrContext* ctx, const GrBackendTexture& tex, GrPix return false; } - return ctx->caps()->validateBackendTexture(tex, ct, config); + return ctx->contextPriv().caps()->validateBackendTexture(tex, ct, config); } sk_sp<SkImage> SkImage::MakeFromTexture(GrContext* ctx, @@ -694,7 +694,8 @@ sk_sp<SkImage> SkImage_Gpu::MakePromiseTexture(GrContext* context, return nullptr; } GrPixelConfig config = kUnknown_GrPixelConfig; - if (!context->caps()->getConfigFromBackendFormat(backendFormat, colorType, &config)) { + if (!context->contextPriv().caps()->getConfigFromBackendFormat(backendFormat, colorType, + &config)) { return nullptr; } @@ -748,12 +749,13 @@ sk_sp<SkImage> SkImage::MakeCrossContextFromEncoded(GrContext* context, sk_sp<Sk } // Some backends or drivers don't support (safely) moving resources between contexts - if (!context || !context->caps()->crossContextTextureSupport()) { + if (!context || !context->contextPriv().caps()->crossContextTextureSupport()) { return codecImage; } - if (limitToMaxTextureSize && (codecImage->width() > context->caps()->maxTextureSize() || - codecImage->height() > context->caps()->maxTextureSize())) { + auto maxTextureSize = context->contextPriv().caps()->maxTextureSize(); + if (limitToMaxTextureSize && + (codecImage->width() > maxTextureSize || codecImage->height() > maxTextureSize)) { SkAutoPixmapStorage pmap; SkImageInfo info = as_IB(codecImage)->onImageInfo(); if (!dstColorSpace) { @@ -801,7 +803,7 @@ sk_sp<SkImage> SkImage::MakeCrossContextFromPixmap(GrContext* context, SkColorSpace* dstColorSpace, bool limitToMaxTextureSize) { // Some backends or drivers don't support (safely) moving resources between contexts - if (!context || !context->caps()->crossContextTextureSupport()) { + if (!context || !context->contextPriv().caps()->crossContextTextureSupport()) { return SkImage::MakeRasterCopy(originalPixmap); } @@ -814,7 +816,7 @@ sk_sp<SkImage> SkImage::MakeCrossContextFromPixmap(GrContext* context, const SkPixmap* pixmap = &originalPixmap; SkAutoPixmapStorage resized; - int maxTextureSize = context->caps()->maxTextureSize(); + int maxTextureSize = context->contextPriv().caps()->maxTextureSize(); int maxDim = SkTMax(originalPixmap.width(), originalPixmap.height()); if (limitToMaxTextureSize && maxDim > maxTextureSize) { float scale = static_cast<float>(maxTextureSize) / maxDim; |