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

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

Issue 1904723003: Revert of Use transfer buffer for BatchAtlas texture copies (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | src/gpu/vk/GrVkGpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index e50f1e2fdbb50d46c7842891ee6e988ef265c3a1..3a7f531476a40e2277eed3d6d5216ecae630a502 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -895,13 +895,13 @@
return success;
}
-bool GrGLGpu::onTransferPixels(GrTexture* texture,
+bool GrGLGpu::onTransferPixels(GrSurface* surface,
int left, int top, int width, int height,
GrPixelConfig config, GrBuffer* transferBuffer,
size_t offset, size_t rowBytes) {
- GrGLTexture* glTex = static_cast<GrGLTexture*>(texture);
-
- if (!check_write_and_transfer_input(glTex, texture, config)) {
+ GrGLTexture* glTex = static_cast<GrGLTexture*>(surface->asTexture());
+
+ if (!check_write_and_transfer_input(glTex, surface, config)) {
return false;
}
@@ -920,16 +920,15 @@
bool success = false;
GrMipLevel mipLevel;
- mipLevel.fPixels = (void*)offset;
+ mipLevel.fPixels = transferBuffer;
mipLevel.fRowBytes = rowBytes;
SkSTArray<1, GrMipLevel> texels;
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(texture, &rect);
+ this->didWriteToSurface(surface, &rect);
return true;
}
@@ -1196,14 +1195,6 @@
SkASSERT(!GrPixelConfigIsCompressed(dataConfig));
SkASSERT(this->caps()->isConfigTexturable(desc.fConfig));
-
- // unbind any previous transfer buffer if not transferring
- auto& xferBufferState = fHWBufferState[kXferCpuToGpu_GrBufferType];
- if (kTransfer_UploadType != uploadType &&
- SK_InvalidUniqueID != xferBufferState.fBoundBufferUniqueID) {
- GL_CALL(BindBuffer(xferBufferState.fGLTarget, 0));
- xferBufferState.invalidate();
- }
// texels is const.
// But we may need to flip the texture vertically to prepare it.
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | src/gpu/vk/GrVkGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698