SkASSERT(bitmap.width() <= fContext->caps()->maxTileSize() &&
bitmap.height() <= fContext->caps()->maxTileSize());
- sk_sp<GrTexture> texture = GrMakeCachedBitmapTexture(
- fContext.get(), bitmap, params, fRenderTargetContext->colorMode());
+ sk_sp<GrTexture> texture = GrMakeCachedBitmapTexture(fContext.get(), bitmap, params);
if (nullptr == texture) {
return;
}
// draw sprite neither filters nor tiles.
texture.reset(
- GrRefCachedBitmapTexture(fContext.get(), bitmap, GrSamplerParams::ClampNoFilter(),
- SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
+ GrRefCachedBitmapTexture(fContext.get(), bitmap, GrSamplerParams::ClampNoFilter()));
if (!texture) {
return;
}
}
sk_sp<GrTexture> texture =
- GrMakeCachedBitmapTexture(fContext.get(), bitmap, GrSamplerParams::ClampNoFilter(),
- SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware);
+ GrMakeCachedBitmapTexture(fContext.get(), bitmap, GrSamplerParams::ClampNoFilter());
if (!texture) {
return nullptr;
}
if (this->shouldTileImage(image, nullptr, SkCanvas::kFast_SrcRectConstraint,
paint.getFilterQuality(), *draw.fMatrix, SkMatrix::I())) {
// only support tiling as bitmap at the moment, so force raster-version
- if (!as_IB(image)->getROPixels(&bm, fRenderTargetContext->colorMode())) {
+ if (!as_IB(image)->getROPixels(&bm, fRenderTargetContext->getColorSpace())) {
return;
}
this->drawBitmap(draw, bm, SkMatrix::MakeTrans(x, y), paint);
GrImageTextureMaker maker(fContext.get(), cacher, image, SkImage::kAllow_CachingHint);
this->drawTextureProducer(&maker, nullptr, nullptr, SkCanvas::kFast_SrcRectConstraint,
viewMatrix, fClip, paint);
- } else if (as_IB(image)->getROPixels(&bm, fRenderTargetContext->colorMode())) {
+ } else if (as_IB(image)->getROPixels(&bm, fRenderTargetContext->getColorSpace())) {
this->drawBitmap(draw, bm, SkMatrix::MakeTrans(x, y), paint);
}
}
if (this->shouldTileImage(image, src, constraint, paint.getFilterQuality(), *draw.fMatrix,
srcToDstRect)) {
// only support tiling as bitmap at the moment, so force raster-version
- if (!as_IB(image)->getROPixels(&bm, fRenderTargetContext->colorMode())) {
+ if (!as_IB(image)->getROPixels(&bm, fRenderTargetContext->getColorSpace())) {
return;
}
this->drawBitmapRect(draw, bm, src, dst, paint, constraint);
CHECK_SHOULD_DRAW(draw);
GrImageTextureMaker maker(fContext.get(), cacher, image, SkImage::kAllow_CachingHint);
this->drawTextureProducer(&maker, src, &dst, constraint, *draw.fMatrix, fClip, paint);
- } else if (as_IB(image)->getROPixels(&bm, fRenderTargetContext->colorMode())) {
+ } else if (as_IB(image)->getROPixels(&bm, fRenderTargetContext->getColorSpace())) {
this->drawBitmapRect(draw, bm, src, dst, paint, constraint);
}
}
producer->createFragmentProcessor(SkMatrix::I(),
SkRect::MakeIWH(producer->width(), producer->height()),
GrTextureProducer::kNo_FilterConstraint, true,
- &kMode, fRenderTargetContext->getColorSpace(),
- fRenderTargetContext->colorMode()));
+ &kMode, fRenderTargetContext->getColorSpace()));
GrPaint grPaint;
if (!SkPaintToGrPaintWithTexture(this->context(), fRenderTargetContext.get(), paint,
*draw.fMatrix, std::move(fp), producer->isAlphaOnly(),
if (SkImageCacherator* cacher = as_IB(image)->peekCacherator()) {
GrImageTextureMaker maker(fContext.get(), cacher, image, SkImage::kAllow_CachingHint);
this->drawProducerNine(draw, &maker, center, dst, paint);
- } else if (as_IB(image)->getROPixels(&bm, fRenderTargetContext->colorMode())) {
+ } else if (as_IB(image)->getROPixels(&bm, fRenderTargetContext->getColorSpace())) {
this->drawBitmapNine(draw, bm, center, dst, paint);
}
}
producer->createFragmentProcessor(SkMatrix::I(),
SkRect::MakeIWH(producer->width(), producer->height()),
GrTextureProducer::kNo_FilterConstraint, true,
- &kMode, fRenderTargetContext->getColorSpace(),
- fRenderTargetContext->colorMode()));
+ &kMode, fRenderTargetContext->getColorSpace()));
GrPaint grPaint;
if (!SkPaintToGrPaintWithTexture(this->context(), fRenderTargetContext.get(), paint,
*draw.fMatrix, std::move(fp), producer->isAlphaOnly(),
if (SkImageCacherator* cacher = as_IB(image)->peekCacherator()) {
GrImageTextureMaker maker(fContext.get(), cacher, image, SkImage::kAllow_CachingHint);
this->drawProducerLattice(draw, &maker, lattice, dst, paint);
- } else if (as_IB(image)->getROPixels(&bm, fRenderTargetContext->colorMode())) {
+ } else if (as_IB(image)->getROPixels(&bm, fRenderTargetContext->getColorSpace())) {
this->drawBitmapLattice(draw, bm, lattice, dst, paint);
}
}