| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |