aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrContext.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-07-27 16:16:25 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-27 22:16:06 +0000
commit16d8ec66cdce2f30ce89b87066d3ac7a244c460d (patch)
treec1428954ad363f7e2b6ce13bbb1640911c7a8262 /src/gpu/GrContext.cpp
parent713195071dc7bdeddec2d1c9fab9b3720f049f07 (diff)
Pull non-substantive changes out of omnibus GrSurface CL
https://skia-review.googlesource.com/c/26363 (Remove origin field from GrSurface) is already too large. This pulls some of the cosmetic changes out for separate review. Change-Id: I1d8b95522144b2f4cbd916ef38faa3dde6f78087 Reviewed-on: https://skia-review.googlesource.com/27840 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rw-r--r--src/gpu/GrContext.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 25408fbde7..347f0b5153 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -401,11 +401,12 @@ bool GrContextPriv::writeSurfacePixels(GrSurfaceContext* dst,
return false;
}
- GrSurface* dstSurface = dst->asSurfaceProxy()->priv().peekSurface();
+ GrSurfaceProxy* dstProxy = dst->asSurfaceProxy();
+ GrSurface* dstSurface = dstProxy->priv().peekSurface();
// The src is unpremul but the dst is premul -> premul the src before or as part of the write
const bool premul = SkToBool(kUnpremul_PixelOpsFlag & pixelOpsFlags);
- if (!valid_pixel_conversion(srcConfig, dstSurface->config(), premul)) {
+ if (!valid_pixel_conversion(srcConfig, dstProxy->config(), premul)) {
return false;
}
@@ -414,7 +415,7 @@ bool GrContextPriv::writeSurfacePixels(GrSurfaceContext* dst,
bool useConfigConversionEffect =
premul &&
pm_upm_must_round_trip(srcConfig, srcColorSpace) &&
- pm_upm_must_round_trip(dstSurface->config(), dst->getColorSpace());
+ pm_upm_must_round_trip(dstProxy->config(), dst->getColorSpace());
// Are we going to try to premul as part of a draw? For the non-legacy case, we always allow
// this. GrConfigConversionEffect fails on some GPUs, so only allow this if it works perfectly.
@@ -432,8 +433,8 @@ bool GrContextPriv::writeSurfacePixels(GrSurfaceContext* dst,
GrGpu::DrawPreference drawPreference = premulOnGpu ? GrGpu::kCallerPrefersDraw_DrawPreference
: GrGpu::kNoDraw_DrawPreference;
GrGpu::WritePixelTempDrawInfo tempDrawInfo;
- if (!fContext->fGpu->getWritePixelsInfo(dstSurface, width, height, srcConfig,
- &drawPreference, &tempDrawInfo)) {
+ if (!fContext->fGpu->getWritePixelsInfo(dstSurface, width, height,
+ srcConfig, &drawPreference, &tempDrawInfo)) {
return false;
}
@@ -531,11 +532,12 @@ bool GrContextPriv::readSurfacePixels(GrSurfaceContext* src,
return false;
}
- GrSurface* srcSurface = src->asSurfaceProxy()->priv().peekSurface();
+ GrSurfaceProxy* srcProxy = src->asSurfaceProxy();
+ GrSurface* srcSurface = srcProxy->priv().peekSurface();
// The src is premul but the dst is unpremul -> unpremul the src after or as part of the read
bool unpremul = SkToBool(kUnpremul_PixelOpsFlag & flags);
- if (!valid_pixel_conversion(srcSurface->config(), dstConfig, unpremul)) {
+ if (!valid_pixel_conversion(srcProxy->config(), dstConfig, unpremul)) {
return false;
}
@@ -543,7 +545,7 @@ bool GrContextPriv::readSurfacePixels(GrSurfaceContext* src,
// without any color spaces attached, and the caller wants us to unpremul.
bool useConfigConversionEffect =
unpremul &&
- pm_upm_must_round_trip(srcSurface->config(), src->getColorSpace()) &&
+ pm_upm_must_round_trip(srcProxy->config(), src->getColorSpace()) &&
pm_upm_must_round_trip(dstConfig, dstColorSpace);
// Are we going to try to unpremul as part of a draw? For the non-legacy case, we always allow
@@ -562,8 +564,8 @@ bool GrContextPriv::readSurfacePixels(GrSurfaceContext* src,
GrGpu::DrawPreference drawPreference = unpremulOnGpu ? GrGpu::kCallerPrefersDraw_DrawPreference
: GrGpu::kNoDraw_DrawPreference;
GrGpu::ReadPixelTempDrawInfo tempDrawInfo;
- if (!fContext->fGpu->getReadPixelsInfo(srcSurface, width, height, rowBytes, dstConfig,
- &drawPreference, &tempDrawInfo)) {
+ if (!fContext->fGpu->getReadPixelsInfo(srcSurface, width, height, rowBytes,
+ dstConfig, &drawPreference, &tempDrawInfo)) {
return false;
}
@@ -639,8 +641,8 @@ bool GrContextPriv::readSurfacePixels(GrSurfaceContext* src,
this->flushSurfaceWrites(proxyToRead.get());
configToRead = tempDrawInfo.fReadConfig;
}
- if (!fContext->fGpu->readPixels(surfaceToRead, left, top, width, height, configToRead,
- buffer, rowBytes)) {
+ if (!fContext->fGpu->readPixels(surfaceToRead,
+ left, top, width, height, configToRead, buffer, rowBytes)) {
return false;
}