GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams) { SkAutoTUnref<GrTexture> original(this->refOriginalTexture()); if (!original) { return nullptr; } return copy_on_gpu(original, nullptr, copyParams); }
GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams, bool willBeMipped, SkSourceGammaTreatment gammaTreatment) { SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped, gammaTreatment)); if (!original) { return nullptr; } return copy_on_gpu(original, nullptr, copyParams); }
GrTexture* GrTextureAdjuster::refCopy(const CopyParams& copyParams) { GrTexture* texture = this->originalTexture(); GrContext* context = texture->getContext(); const SkIRect* contentArea = this->contentAreaOrNull(); GrUniqueKey key; this->makeCopyKey(copyParams, &key); if (key.isValid()) { GrTexture* cachedCopy = context->textureProvider()->findAndRefTextureByUniqueKey(key); if (cachedCopy) { return cachedCopy; } } GrTexture* copy = copy_on_gpu(texture, contentArea, copyParams); if (copy) { if (key.isValid()) { copy->resourcePriv().setUniqueKey(key); this->didCacheCopy(key); } } return copy; }