aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrBackendTextureImageGenerator.cpp4
-rw-r--r--src/gpu/GrContext.cpp10
-rw-r--r--src/gpu/GrTextureProducer.cpp3
-rw-r--r--src/gpu/GrYUVProvider.cpp2
-rw-r--r--src/gpu/SkGpuDevice.cpp5
-rw-r--r--src/gpu/gl/GrGLGpu.cpp2
6 files changed, 15 insertions, 11 deletions
diff --git a/src/gpu/GrBackendTextureImageGenerator.cpp b/src/gpu/GrBackendTextureImageGenerator.cpp
index 7240c7976f..58dacf6549 100644
--- a/src/gpu/GrBackendTextureImageGenerator.cpp
+++ b/src/gpu/GrBackendTextureImageGenerator.cpp
@@ -183,9 +183,11 @@ sk_sp<GrTextureProxy> GrBackendTextureImageGenerator::onGenerateTexture(
// Otherwise, make a copy of the requested subset. Make sure our temporary is renderable,
// because Vulkan will want to do the copy as a draw. All other copies would require a
// layout change in Vulkan and we do not change the layout of borrowed images.
+ GrMipMapped mipMapped = willNeedMipMaps ? GrMipMapped::kYes : GrMipMapped::kNo;
+
sk_sp<GrRenderTargetContext> rtContext(context->makeDeferredRenderTargetContext(
SkBackingFit::kExact, info.width(), info.height(), proxy->config(), nullptr,
- 0, willNeedMipMaps, proxy->origin(), nullptr, SkBudgeted::kYes));
+ 0, mipMapped, proxy->origin(), nullptr, SkBudgeted::kYes));
if (!rtContext) {
return nullptr;
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 605fe2e793..2d9f0115e3 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -617,7 +617,7 @@ bool GrContextPriv::readSurfacePixels(GrSurfaceContext* src,
tempDrawInfo.fTempSurfaceDesc.fConfig,
nullptr,
tempDrawInfo.fTempSurfaceDesc.fSampleCnt,
- false,
+ GrMipMapped::kNo,
tempDrawInfo.fTempSurfaceDesc.fOrigin);
if (tempRTC) {
SkMatrix textureMatrix = SkMatrix::MakeTrans(SkIntToScalar(left), SkIntToScalar(top));
@@ -885,7 +885,7 @@ sk_sp<GrRenderTargetContext> GrContext::makeDeferredRenderTargetContextWithFallb
GrPixelConfig config,
sk_sp<SkColorSpace> colorSpace,
int sampleCnt,
- bool willNeedMipMaps,
+ GrMipMapped mipMapped,
GrSurfaceOrigin origin,
const SkSurfaceProps* surfaceProps,
SkBudgeted budgeted) {
@@ -894,7 +894,7 @@ sk_sp<GrRenderTargetContext> GrContext::makeDeferredRenderTargetContextWithFallb
}
return this->makeDeferredRenderTargetContext(fit, width, height, config, std::move(colorSpace),
- sampleCnt, willNeedMipMaps, origin, surfaceProps,
+ sampleCnt, mipMapped, origin, surfaceProps,
budgeted);
}
@@ -904,7 +904,7 @@ sk_sp<GrRenderTargetContext> GrContext::makeDeferredRenderTargetContext(
GrPixelConfig config,
sk_sp<SkColorSpace> colorSpace,
int sampleCnt,
- bool willNeedMipMaps,
+ GrMipMapped mipMapped,
GrSurfaceOrigin origin,
const SkSurfaceProps* surfaceProps,
SkBudgeted budgeted) {
@@ -921,7 +921,7 @@ sk_sp<GrRenderTargetContext> GrContext::makeDeferredRenderTargetContext(
desc.fSampleCnt = sampleCnt;
sk_sp<GrTextureProxy> rtp;
- if (!willNeedMipMaps) {
+ if (GrMipMapped::kNo == mipMapped) {
rtp = GrSurfaceProxy::MakeDeferred(this->resourceProvider(), desc, fit, budgeted);
} else {
rtp = GrSurfaceProxy::MakeDeferredMipMap(this->resourceProvider(), desc, budgeted);
diff --git a/src/gpu/GrTextureProducer.cpp b/src/gpu/GrTextureProducer.cpp
index cf7ee7cca7..f5ae0ad565 100644
--- a/src/gpu/GrTextureProducer.cpp
+++ b/src/gpu/GrTextureProducer.cpp
@@ -23,10 +23,11 @@ sk_sp<GrTextureProxy> GrTextureProducer::CopyOnGpu(GrContext* context,
SkASSERT(context);
const SkRect dstRect = SkRect::MakeIWH(copyParams.fWidth, copyParams.fHeight);
+ GrMipMapped mipMapped = dstWillRequireMipMaps ? GrMipMapped::kYes : GrMipMapped::kNo;
sk_sp<GrRenderTargetContext> copyRTC = context->makeDeferredRenderTargetContextWithFallback(
SkBackingFit::kExact, dstRect.width(), dstRect.height(), inputProxy->config(), nullptr,
- 0, dstWillRequireMipMaps, inputProxy->origin());
+ 0, mipMapped, inputProxy->origin());
if (!copyRTC) {
return nullptr;
}
diff --git a/src/gpu/GrYUVProvider.cpp b/src/gpu/GrYUVProvider.cpp
index d6a56660a4..930a33e961 100644
--- a/src/gpu/GrYUVProvider.cpp
+++ b/src/gpu/GrYUVProvider.cpp
@@ -131,7 +131,7 @@ sk_sp<GrTextureProxy> GrYUVProvider::refAsTextureProxy(GrContext* ctx, const GrS
desc.fWidth, desc.fHeight,
desc.fConfig, nullptr,
desc.fSampleCnt,
- false, // always non mipped
+ GrMipMapped::kNo,
kTopLeft_GrSurfaceOrigin));
if (!renderTargetContext) {
return nullptr;
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index fe1f6aefaa..df81d0494b 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -164,7 +164,7 @@ sk_sp<GrRenderTargetContext> SkGpuDevice::MakeRenderTargetContext(
SkBackingFit::kExact,
origInfo.width(), origInfo.height(),
config, origInfo.refColorSpace(), sampleCount,
- false, origin, surfaceProps, budgeted);
+ mipMapped, origin, surfaceProps, budgeted);
}
sk_sp<SkSpecialImage> SkGpuDevice::filterTexture(SkSpecialImage* srcImg,
@@ -1703,7 +1703,8 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint
fit, cinfo.fInfo.width(), cinfo.fInfo.height(),
fRenderTargetContext->colorSpaceInfo().config(),
fRenderTargetContext->colorSpaceInfo().refColorSpace(),
- fRenderTargetContext->numStencilSamples(), false, kBottomLeft_GrSurfaceOrigin, &props));
+ fRenderTargetContext->numStencilSamples(), GrMipMapped::kNo,
+ kBottomLeft_GrSurfaceOrigin, &props));
if (!rtc) {
return nullptr;
}
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 1bee54879e..d3bd6e3cd0 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -4415,7 +4415,7 @@ GrBackendObject GrGLGpu::createTestingOnlyBackendTexture(void* pixels, int w, in
int width = w;
int height = h;
for (int i = 0; i < mipLevels; ++i) {
- GL_CALL(TexImage2D(info->fTarget, 0, internalFormat, width, height, 0, externalFormat,
+ GL_CALL(TexImage2D(info->fTarget, i, internalFormat, width, height, 0, externalFormat,
externalType, pixels));
width = SkTMax(1, width / 2);
height = SkTMax(1, height / 2);