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

Side by Side Diff: src/gpu/gl/GrGLGpu.cpp

Issue 2165523003: Convert readSurfacePixels to use a draw context instead of a texture (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/vk/GrVkGpu.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrGLGpu.h" 8 #include "GrGLGpu.h"
9 #include "GrGLBuffer.h" 9 #include "GrGLBuffer.h"
10 #include "GrGLGLSL.h" 10 #include "GrGLGLSL.h"
(...skipping 2310 matching lines...) Expand 10 before | Expand all | Expand 10 after
2321 GrPixelConfig readConfig, DrawPreference* draw Preference, 2321 GrPixelConfig readConfig, DrawPreference* draw Preference,
2322 ReadPixelTempDrawInfo* tempDrawInfo) { 2322 ReadPixelTempDrawInfo* tempDrawInfo) {
2323 GrPixelConfig srcConfig = srcSurface->config(); 2323 GrPixelConfig srcConfig = srcSurface->config();
2324 2324
2325 // These settings we will always want if a temp draw is performed. 2325 // These settings we will always want if a temp draw is performed.
2326 tempDrawInfo->fTempSurfaceDesc.fFlags = kRenderTarget_GrSurfaceFlag; 2326 tempDrawInfo->fTempSurfaceDesc.fFlags = kRenderTarget_GrSurfaceFlag;
2327 tempDrawInfo->fTempSurfaceDesc.fWidth = width; 2327 tempDrawInfo->fTempSurfaceDesc.fWidth = width;
2328 tempDrawInfo->fTempSurfaceDesc.fHeight = height; 2328 tempDrawInfo->fTempSurfaceDesc.fHeight = height;
2329 tempDrawInfo->fTempSurfaceDesc.fSampleCnt = 0; 2329 tempDrawInfo->fTempSurfaceDesc.fSampleCnt = 0;
2330 tempDrawInfo->fTempSurfaceDesc.fOrigin = kTopLeft_GrSurfaceOrigin; // no CPU y-flip for TL. 2330 tempDrawInfo->fTempSurfaceDesc.fOrigin = kTopLeft_GrSurfaceOrigin; // no CPU y-flip for TL.
2331 tempDrawInfo->fUseExactScratch = this->glCaps().partialFBOReadIsSlow(); 2331 tempDrawInfo->fTempSurfaceFit = this->glCaps().partialFBOReadIsSlow() ? SkBa ckingFit::kExact
2332 2332 : SkBa ckingFit::kApprox;
2333 // For now assume no swizzling, we may change that below. 2333 // For now assume no swizzling, we may change that below.
2334 tempDrawInfo->fSwizzle = GrSwizzle::RGBA(); 2334 tempDrawInfo->fSwizzle = GrSwizzle::RGBA();
2335 2335
2336 // Depends on why we need/want a temp draw. Start off assuming no change, th e surface we read 2336 // Depends on why we need/want a temp draw. Start off assuming no change, th e surface we read
2337 // from will be srcConfig and we will read readConfig pixels from it. 2337 // from will be srcConfig and we will read readConfig pixels from it.
2338 // Not that if we require a draw and return a non-renderable format for the temp surface the 2338 // Not that if we require a draw and return a non-renderable format for the temp surface the
2339 // base class will fail for us. 2339 // base class will fail for us.
2340 tempDrawInfo->fTempSurfaceDesc.fConfig = srcConfig; 2340 tempDrawInfo->fTempSurfaceDesc.fConfig = srcConfig;
2341 tempDrawInfo->fReadConfig = readConfig; 2341 tempDrawInfo->fReadConfig = readConfig;
2342 2342
(...skipping 2270 matching lines...) Expand 10 before | Expand all | Expand 10 after
4613 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() || 4613 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() ||
4614 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) { 4614 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) {
4615 copyParams->fFilter = GrTextureParams::kNone_FilterMode; 4615 copyParams->fFilter = GrTextureParams::kNone_FilterMode;
4616 copyParams->fWidth = texture->width(); 4616 copyParams->fWidth = texture->width();
4617 copyParams->fHeight = texture->height(); 4617 copyParams->fHeight = texture->height();
4618 return true; 4618 return true;
4619 } 4619 }
4620 } 4620 }
4621 return false; 4621 return false;
4622 } 4622 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/vk/GrVkGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698