aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLGpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl/GrGLGpu.cpp')
-rw-r--r--src/gpu/gl/GrGLGpu.cpp36
1 files changed, 9 insertions, 27 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index f3aac8afc1..045804c668 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -582,10 +582,7 @@ sk_sp<GrTexture> GrGLGpu::onWrapBackendTexture(const GrBackendTexture& backendTe
if (!this->createRenderTargetObjects(surfDesc, idDesc.fInfo, &rtIDDesc)) {
return nullptr;
}
- sk_sp<GrGLTextureRenderTarget> texRT(
- GrGLTextureRenderTarget::MakeWrapped(this, surfDesc, idDesc, rtIDDesc));
- texRT->baseLevelWasBoundToFBO();
- return texRT;
+ return GrGLTextureRenderTarget::MakeWrapped(this, surfDesc, idDesc, rtIDDesc);
}
return GrGLTexture::MakeWrapped(this, surfDesc, idDesc);
@@ -665,28 +662,16 @@ bool GrGLGpu::onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height,
GrPixelConfig srcConfig,
DrawPreference* drawPreference,
WritePixelTempDrawInfo* tempDrawInfo) {
- if (SkToBool(dstSurface->asRenderTarget())) {
- if (this->glCaps().useDrawInsteadOfAllRenderTargetWrites()) {
- ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference);
- }
- }
-
- GrGLTexture* texture = static_cast<GrGLTexture*>(dstSurface->asTexture());
-
- if (texture) {
+ // This subclass only allows writes to textures. If the dst is not a texture we have to draw
+ // into it. We could use glDrawPixels on GLs that have it, but we don't today.
+ if (!dstSurface->asTexture()) {
+ ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference);
+ } else {
+ GrGLTexture* texture = static_cast<GrGLTexture*>(dstSurface->asTexture());
if (GR_GL_TEXTURE_EXTERNAL == texture->target()) {
// We don't currently support writing pixels to EXTERNAL textures.
return false;
}
- if (texture->hasBaseLevelBeenBoundToFBO() &&
- this->glCaps().disallowTexSubImageForTexturesEverBoundToFBO() &&
- (width < dstSurface->width() || height < dstSurface->height())) {
- ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference);
- }
- } else {
- // This subclass only allows writes to textures. If the dst is not a texture we have to draw
- // into it. We could use glDrawPixels on GLs that have it, but we don't today.
- ElevateDrawPreference(drawPreference, kRequireDraw_DrawPreference);
}
// If the dst is MSAA, we have to draw, or we'll just be writing to the resolve target.
@@ -1388,7 +1373,6 @@ GrTexture* GrGLGpu::onCreateTexture(const GrSurfaceDesc& desc,
}
tex = new GrGLTextureRenderTarget(this, budgeted, desc, idDesc, rtIDDesc,
wasMipMapDataProvided);
- tex->baseLevelWasBoundToFBO();
} else {
tex = new GrGLTexture(this, budgeted, desc, idDesc, wasMipMapDataProvided);
}
@@ -3233,9 +3217,8 @@ void GrGLGpu::bindSurfaceFBOForPixelOps(GrSurface* surface, GrGLenum fboTarget,
GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(surface->asRenderTarget());
if (!rt) {
SkASSERT(surface->asTexture());
- GrGLTexture* texture = static_cast<GrGLTexture*>(surface->asTexture());
- GrGLuint texID = texture->textureID();
- GrGLenum target = texture->target();
+ GrGLuint texID = static_cast<GrGLTexture*>(surface->asTexture())->textureID();
+ GrGLenum target = static_cast<GrGLTexture*>(surface->asTexture())->target();
GrGLuint* tempFBOID;
tempFBOID = kSrc_TempFBOTarget == tempFBOTarget ? &fTempSrcFBOID : &fTempDstFBOID;
@@ -3250,7 +3233,6 @@ void GrGLGpu::bindSurfaceFBOForPixelOps(GrSurface* surface, GrGLenum fboTarget,
target,
texID,
0));
- texture->baseLevelWasBoundToFBO();
viewport->fLeft = 0;
viewport->fBottom = 0;
viewport->fWidth = surface->width();