////////////////////////////////////////////////////////////////////////////////
-bool GrGpu::makeCopyForTextureParams(int width, int height, const GrSamplerParams& textureParams,
- GrTextureProducer::CopyParams* copyParams,
- SkScalar scaleAdjust[2]) const {
+bool GrGpu::isACopyNeededForTextureParams(int width, int height,
+ const GrSamplerParams& textureParams,
+ GrTextureProducer::CopyParams* copyParams,
+ SkScalar scaleAdjust[2]) const {
const GrCaps& caps = *this->caps();
if (textureParams.isTiled() && !caps.npotTextureTileSupport() &&
(!SkIsPow2(width) || !SkIsPow2(height))) {
// Determines whether a texture will need to be rescaled in order to be used with the
// GrSamplerParams. This variation is called when the caller will create a new texture using the
// resource provider from a non-texture src (cpu-backed image, ...).
- bool makeCopyForTextureParams(int width, int height, const GrSamplerParams&,
- GrTextureProducer::CopyParams*, SkScalar scaleAdjust[2]) const;
+ bool isACopyNeededForTextureParams(int width, int height, const GrSamplerParams&,
+ GrTextureProducer::CopyParams*,
+ SkScalar scaleAdjust[2]) const;
// Like the above but this variation should be called when the caller is not creating the
// original texture but rather was handed the original texture. It adds additional checks
// relevant to original textures that were created external to Skia via
// GrResourceProvider::wrap methods.
- bool makeCopyForTextureParams(GrTexture* texture, const GrSamplerParams& params,
- GrTextureProducer::CopyParams* copyParams,
- SkScalar scaleAdjust[2]) const {
- if (this->makeCopyForTextureParams(texture->width(), texture->height(), params,
- copyParams, scaleAdjust)) {
+ bool isACopyNeededForTextureParams(GrTexture* texture, const GrSamplerParams& params,
+ GrTextureProducer::CopyParams* copyParams,
+ SkScalar scaleAdjust[2]) const {
+ if (this->isACopyNeededForTextureParams(texture->width(), texture->height(), params,
+ copyParams, scaleAdjust)) {
return true;
}
- return this->onMakeCopyForTextureParams(texture, params, copyParams, scaleAdjust);
+ return this->onIsACopyNeededForTextureParams(texture, params, copyParams, scaleAdjust);
}
// This is only to be used in GL-specific tests.
virtual gr_instanced::InstancedRendering* onCreateInstancedRendering() = 0;
- virtual bool onMakeCopyForTextureParams(GrTexture* texture, const GrSamplerParams&,
- GrTextureProducer::CopyParams*,
- SkScalar scaleAdjust[2]) const { return false; }
+ virtual bool onIsACopyNeededForTextureParams(GrTexture* texture, const GrSamplerParams&,
+ GrTextureProducer::CopyParams*,
+ SkScalar scaleAdjust[2]) const {
+ return false;
+ }
virtual bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeight,
size_t rowBytes, GrPixelConfig readConfig, DrawPreference*,
copyParams.fWidth = contentArea->width();
copyParams.fHeight = contentArea->height();
copyParams.fFilter = GrSamplerParams::kBilerp_FilterMode;
- } else if (!fContext->getGpu()->makeCopyForTextureParams(texture, params, ©Params,
- scaleAdjust)) {
+ } else if (!fContext->getGpu()->isACopyNeededForTextureParams(texture, params, ©Params,
+ scaleAdjust)) {
if (outOffset) {
if (contentArea) {
outOffset->set(contentArea->fLeft, contentArea->fRight);
*texColorSpace = this->getColorSpace(dstColorSpace);
}
- if (!fContext->getGpu()->makeCopyForTextureParams(this->width(), this->height(), params,
- ©Params, scaleAdjust)) {
+ if (!fContext->getGpu()->isACopyNeededForTextureParams(this->width(), this->height(), params,
+ ©Params, scaleAdjust)) {
return this->refOriginalTexture(willBeMipped, dstColorSpace);
}
GrUniqueKey copyKey;
return attribState;
}
-bool GrGLGpu::onMakeCopyForTextureParams(GrTexture* texture, const GrSamplerParams& textureParams,
- GrTextureProducer::CopyParams* copyParams,
- SkScalar scaleAdjust[2]) const {
+bool GrGLGpu::onIsACopyNeededForTextureParams(GrTexture* texture,
+ const GrSamplerParams& textureParams,
+ GrTextureProducer::CopyParams* copyParams,
+ SkScalar scaleAdjust[2]) const {
if (textureParams.isTiled() ||
GrSamplerParams::kMipMap_FilterMode == textureParams.filterMode()) {
GrGLTexture* glTexture = static_cast<GrGLTexture*>(texture);
bool renderTarget, GrGLTexture::TexParams* initialTexParams,
const SkTArray<GrMipLevel>& texels);
- bool onMakeCopyForTextureParams(GrTexture*, const GrSamplerParams&,
- GrTextureProducer::CopyParams*,
- SkScalar scaleAdjust[2]) const override;
+ bool onIsACopyNeededForTextureParams(GrTexture*, const GrSamplerParams&,
+ GrTextureProducer::CopyParams*,
+ SkScalar scaleAdjust[2]) const override;
// Checks whether glReadPixels can be called to get pixel values in readConfig from the
// render target.