Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(567)

Unified Diff: src/gpu/gl/GrGLGpu.cpp

Issue 1925303002: Add mipmap loading to Vulkan. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixes to handle mipmap allocations and autogen Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 7eb833c880ac5fd91bc7aa5b88abdd38ed58fa6a..3372d4289701ef03a8c7900c66c7434e8c9aa26e 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -880,11 +880,6 @@ bool GrGLGpu::onWritePixels(GrSurface* surface,
left, top, width, height, config, texels);
}
- if (success) {
- SkIRect rect = SkIRect::MakeXYWH(left, top, width, height);
- this->didWriteToSurface(surface, &rect, texels.count());
- }
-
return success;
}
@@ -919,13 +914,7 @@ bool GrGLGpu::onTransferPixels(GrSurface* surface,
texels.push_back(mipLevel);
success = this->uploadTexData(glTex->desc(), glTex->target(), kTransfer_UploadType,
left, top, width, height, config, texels);
- if (success) {
- SkIRect rect = SkIRect::MakeXYWH(left, top, width, height);
- this->didWriteToSurface(surface, &rect);
- return true;
- }
-
- return false;
+ return success;
}
// For GL_[UN]PACK_ALIGNMENT.
@@ -2672,20 +2661,6 @@ void GrGLGpu::flushViewport(const GrGLIRect& viewport) {
}
}
-void GrGLGpu::didWriteToSurface(GrSurface* surface, const SkIRect* bounds, int mipLevels) const {
- SkASSERT(surface);
- // Mark any MIP chain and resolve buffer as dirty if and only if there is a non-empty bounds.
- if (nullptr == bounds || !bounds->isEmpty()) {
- if (GrRenderTarget* target = surface->asRenderTarget()) {
- target->flagAsNeedingResolve(bounds);
- }
- GrTexture* texture = surface->asTexture();
- if (texture && 1 == mipLevels) {
- texture->texturePriv().dirtyMipMaps(true);
- }
- }
-}
-
GrGLenum gPrimitiveType2GLMode[] = {
GR_GL_TRIANGLES,
GR_GL_TRIANGLE_STRIP,

Powered by Google App Engine
This is Rietveld 408576698