aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-03-27 11:08:16 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-27 16:31:02 +0000
commit3798c86f6885f0b47fb2e659a43b48a4468a97ef (patch)
tree8670d4adcc7889af63b4168256f0325aa78aa3bd /src/gpu/gl
parent465748c246dde8c131effdfa69aed82ef7a48af8 (diff)
Remove GrFragmentProcessor-derived class' GrTexture-based ctors
Split out into: https://skia-review.googlesource.com/c/8881/ (Switch GrTextureStripAtlas over to GrTextureProxies) https://skia-review.googlesource.com/c/8942/ (Wrap cached GrTextures in GrTextureProxies (e.g., blur profiles, nine-patch blurs, etc.)) https://skia-review.googlesource.com/c/8997/ (Clean up/remove unused GrFragmentProcessor-derived ctors) https://skia-review.googlesource.com/c/9191/ (Switch SkImageGenerator over to generating GrTextureProxies) https://skia-review.googlesource.com/c/9448/ (Switch GrYUVProvider over to GrTextureProxies) https://skia-review.googlesource.com/c/9559/ (Preparatory Proxification) https://skia-review.googlesource.com/c/9626/ (Consolidate Proxy caching code in GrResourceProvider) https://skia-review.googlesource.com/c/9683/ (More pre-emptive proxification) https://skia-review.googlesource.com/c/9917/ (Make experimental Perlin noise shader take texture proxies) https://skia-review.googlesource.com/c/9961/ (rename makeCopyForTextureParams to isACopyNeededForTextureParams) https://skia-review.googlesource.com/c/9945/ (Make SkImageCacherator be deferred) https://skia-review.googlesource.com/c/10180/ (Add new proxy-based DetermineDomainMode w/ test) Change-Id: Ia33389d92360e542a9d2bf395948deb04d017465 Reviewed-on: https://skia-review.googlesource.com/8823 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/GrGLGpu.cpp12
-rw-r--r--src/gpu/gl/GrGLGpu.h2
2 files changed, 11 insertions, 3 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index f7b32c27ba..19d3197e5a 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -20,6 +20,7 @@
#include "GrRenderTargetPriv.h"
#include "GrShaderCaps.h"
#include "GrSurfacePriv.h"
+#include "GrSurfaceProxyPriv.h"
#include "GrTexturePriv.h"
#include "GrTypes.h"
#include "SkAutoMalloc.h"
@@ -4421,13 +4422,20 @@ GrGLAttribArrayState* GrGLGpu::HWVertexArrayState::bindInternalVertexArray(GrGLG
return attribState;
}
-bool GrGLGpu::onIsACopyNeededForTextureParams(GrTexture* texture,
+bool GrGLGpu::onIsACopyNeededForTextureParams(GrTextureProxy* proxy,
const GrSamplerParams& textureParams,
GrTextureProducer::CopyParams* copyParams,
SkScalar scaleAdjust[2]) const {
+ const GrTexture* texture = proxy->priv().peekTexture();
+ if (!texture) {
+ // The only way to get and EXTERNAL or RECTANGLE texture in Ganesh is to wrap them.
+ // In that case the proxy should already be instantiated.
+ return false;
+ }
+
if (textureParams.isTiled() ||
GrSamplerParams::kMipMap_FilterMode == textureParams.filterMode()) {
- GrGLTexture* glTexture = static_cast<GrGLTexture*>(texture);
+ const GrGLTexture* glTexture = static_cast<const GrGLTexture*>(texture);
if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() ||
GR_GL_TEXTURE_RECTANGLE == glTexture->target()) {
copyParams->fFilter = GrSamplerParams::kNone_FilterMode;
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index 6e0d900b6e..1fc25576fe 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -189,7 +189,7 @@ private:
bool renderTarget, GrGLTexture::TexParams* initialTexParams,
const SkTArray<GrMipLevel>& texels);
- bool onIsACopyNeededForTextureParams(GrTexture*, const GrSamplerParams&,
+ bool onIsACopyNeededForTextureParams(GrTextureProxy*, const GrSamplerParams&,
GrTextureProducer::CopyParams*,
SkScalar scaleAdjust[2]) const override;