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 "GrGLGLSL.h" | 9 #include "GrGLGLSL.h" |
10 #include "GrGLStencilAttachment.h" | 10 #include "GrGLStencilAttachment.h" |
(...skipping 2179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2190 GrPixelConfig rtConfig = target->config(); | 2190 GrPixelConfig rtConfig = target->config(); |
2191 return this->glCaps().readPixelsSupported(rtConfig, readConfig, getIntegerv,
bindRenderTarget); | 2191 return this->glCaps().readPixelsSupported(rtConfig, readConfig, getIntegerv,
bindRenderTarget); |
2192 } | 2192 } |
2193 | 2193 |
2194 bool GrGLGpu::readPixelsSupported(GrPixelConfig rtConfig, GrPixelConfig readConf
ig) { | 2194 bool GrGLGpu::readPixelsSupported(GrPixelConfig rtConfig, GrPixelConfig readConf
ig) { |
2195 auto bindRenderTarget = [this, rtConfig]() -> bool { | 2195 auto bindRenderTarget = [this, rtConfig]() -> bool { |
2196 GrTextureDesc desc; | 2196 GrTextureDesc desc; |
2197 desc.fConfig = rtConfig; | 2197 desc.fConfig = rtConfig; |
2198 desc.fWidth = desc.fHeight = 16; | 2198 desc.fWidth = desc.fHeight = 16; |
2199 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 2199 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
2200 SkAutoTUnref<GrTexture> temp(this->createTexture(desc, SkBudgeted::kNo,
nullptr, 0)); | 2200 SkAutoTUnref<GrTexture> temp(this->createTexture(desc, false, nullptr, 0
)); |
2201 if (!temp) { | 2201 if (!temp) { |
2202 return false; | 2202 return false; |
2203 } | 2203 } |
2204 GrGLRenderTarget* glrt = static_cast<GrGLRenderTarget*>(temp->asRenderTa
rget()); | 2204 GrGLRenderTarget* glrt = static_cast<GrGLRenderTarget*>(temp->asRenderTa
rget()); |
2205 this->flushRenderTarget(glrt, &SkIRect::EmptyIRect()); | 2205 this->flushRenderTarget(glrt, &SkIRect::EmptyIRect()); |
2206 return true; | 2206 return true; |
2207 }; | 2207 }; |
2208 auto getIntegerv = [this](GrGLenum query, GrGLint* value) { | 2208 auto getIntegerv = [this](GrGLenum query, GrGLint* value) { |
2209 GR_GL_GetIntegerv(this->glInterface(), query, value); | 2209 GR_GL_GetIntegerv(this->glInterface(), query, value); |
2210 }; | 2210 }; |
(...skipping 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4009 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() || | 4009 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() || |
4010 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) { | 4010 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) { |
4011 copyParams->fFilter = GrTextureParams::kNone_FilterMode; | 4011 copyParams->fFilter = GrTextureParams::kNone_FilterMode; |
4012 copyParams->fWidth = texture->width(); | 4012 copyParams->fWidth = texture->width(); |
4013 copyParams->fHeight = texture->height(); | 4013 copyParams->fHeight = texture->height(); |
4014 return true; | 4014 return true; |
4015 } | 4015 } |
4016 } | 4016 } |
4017 return false; | 4017 return false; |
4018 } | 4018 } |
OLD | NEW |