aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-02-28 16:20:03 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-28 22:07:05 +0000
commit32f2818c9d10090efeea62ccc211d48a33322dfb (patch)
treefd301bc81387a3c3e0cc767cba43ba214a314f86 /src/gpu/text
parentdac5f6bcbec7130a209a6899444feb022719498d (diff)
Clean up/remove unused GrFragmentProcessor-derived ctors
This is the simple (i.e., non-TextureAdjuster) portion of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors) Change-Id: I8f673ebe922e03c69473c18c166bcf818507c662 Reviewed-on: https://skia-review.googlesource.com/8997 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/text')
-rw-r--r--src/gpu/text/GrAtlasGlyphCache.cpp12
-rw-r--r--src/gpu/text/GrAtlasGlyphCache.h8
2 files changed, 10 insertions, 10 deletions
diff --git a/src/gpu/text/GrAtlasGlyphCache.cpp b/src/gpu/text/GrAtlasGlyphCache.cpp
index 95cadd86df..cf56c897d6 100644
--- a/src/gpu/text/GrAtlasGlyphCache.cpp
+++ b/src/gpu/text/GrAtlasGlyphCache.cpp
@@ -27,8 +27,8 @@ bool GrAtlasGlyphCache::initAtlas(GrMaskFormat format) {
int numPlotsY = fAtlasConfigs[index].numPlotsY();
fAtlases[index] = fContext->resourceProvider()->makeAtlas(
- config, width, height, numPlotsX, numPlotsY, &GrAtlasGlyphCache::HandleEviction,
- (void*)this);
+ fContext, config, width, height, numPlotsX, numPlotsY,
+ &GrAtlasGlyphCache::HandleEviction, (void*)this);
if (!fAtlases[index]) {
return false;
}
@@ -166,8 +166,8 @@ void GrAtlasGlyphCache::dump() const {
static int gDumpCount = 0;
for (int i = 0; i < kMaskFormatCount; ++i) {
if (fAtlases[i]) {
- GrTexture* texture = fAtlases[i]->getTexture();
- if (texture) {
+ sk_sp<GrTextureProxy> proxy = fAtlases[i]->getProxy();
+ if (proxy) {
SkString filename;
#ifdef SK_BUILD_FOR_ANDROID
filename.printf("/sdcard/fontcache_%d%d.png", gDumpCount, i);
@@ -175,9 +175,7 @@ void GrAtlasGlyphCache::dump() const {
filename.printf("fontcache_%d%d.png", gDumpCount, i);
#endif
- sk_sp<GrSurfaceProxy> sProxy(GrSurfaceProxy::MakeWrapped(sk_ref_sp(texture)));
-
- save_pixels(fContext, sProxy.get(), filename.c_str());
+ save_pixels(fContext, proxy.get(), filename.c_str());
}
}
}
diff --git a/src/gpu/text/GrAtlasGlyphCache.h b/src/gpu/text/GrAtlasGlyphCache.h
index 57b65baba2..9e97966952 100644
--- a/src/gpu/text/GrAtlasGlyphCache.h
+++ b/src/gpu/text/GrAtlasGlyphCache.h
@@ -126,12 +126,12 @@ public:
void freeAll();
- // if texture returns nullptr, the client must not try to use other functions on the
+ // if getProxy returns nullptr, the client must not try to use other functions on the
// GrAtlasGlyphCache which use the atlas. This function *must* be called first, before other
// functions which use the atlas.
- GrTexture* getTexture(GrMaskFormat format) {
+ sk_sp<GrTextureProxy> getProxy(GrMaskFormat format) {
if (this->initAtlas(format)) {
- return this->getAtlas(format)->getTexture();
+ return this->getAtlas(format)->getProxy();
}
return nullptr;
}
@@ -185,6 +185,8 @@ public:
void setAtlasSizes_ForTesting(const GrDrawOpAtlasConfig configs[3]);
+ GrContext* context() const { return fContext; }
+
private:
static GrPixelConfig MaskFormatToPixelConfig(GrMaskFormat format, const GrCaps& caps) {
switch (format) {