Remove old sRGB config support from backend render target tool utilities
Bug: skia: Change-Id: Ie88c16ddb2b072d8bdd7efc3acabc1d9ad89012f Reviewed-on: https://skia-review.googlesource.com/146526 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
parent
b2c4ea6219
commit
2d010b66a6
@ -1507,12 +1507,9 @@ Error GPUSink::onDraw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log,
|
||||
break;
|
||||
case SkCommandLineConfigGpu::SurfType::kBackendRenderTarget:
|
||||
if (1 == fSampleCount) {
|
||||
auto srgbEncoded = info.colorSpace() && info.colorSpace()->gammaCloseToSRGB()
|
||||
? GrSRGBEncoded::kYes
|
||||
: GrSRGBEncoded::kNo;
|
||||
auto colorType = SkColorTypeToGrColorType(info.colorType());
|
||||
backendRT = context->contextPriv().getGpu()->createTestingOnlyBackendRenderTarget(
|
||||
info.width(), info.height(), colorType, srgbEncoded);
|
||||
info.width(), info.height(), colorType);
|
||||
surface = SkSurface::MakeFromBackendRenderTarget(
|
||||
context, backendRT, kBottomLeft_GrSurfaceOrigin, info.colorType(),
|
||||
info.refColorSpace(), &props);
|
||||
|
@ -355,8 +355,8 @@ public:
|
||||
*/
|
||||
virtual void deleteTestingOnlyBackendTexture(const GrBackendTexture&) = 0;
|
||||
|
||||
virtual GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType,
|
||||
GrSRGBEncoded) = 0;
|
||||
virtual GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h,
|
||||
GrColorType) = 0;
|
||||
|
||||
virtual void deleteTestingOnlyBackendRenderTarget(const GrBackendRenderTarget&) = 0;
|
||||
|
||||
|
@ -3986,13 +3986,12 @@ void GrGLGpu::deleteTestingOnlyBackendTexture(const GrBackendTexture& tex) {
|
||||
}
|
||||
|
||||
GrBackendRenderTarget GrGLGpu::createTestingOnlyBackendRenderTarget(int w, int h,
|
||||
GrColorType colorType,
|
||||
GrSRGBEncoded srgbEncoded) {
|
||||
GrColorType colorType) {
|
||||
if (w > this->caps()->maxRenderTargetSize() || h > this->caps()->maxRenderTargetSize()) {
|
||||
return GrBackendRenderTarget(); // invalid
|
||||
}
|
||||
this->handleDirtyContext();
|
||||
auto config = GrColorTypeToPixelConfig(colorType, srgbEncoded);
|
||||
auto config = GrColorTypeToPixelConfig(colorType, GrSRGBEncoded::kNo);
|
||||
GrGLenum colorBufferFormat;
|
||||
if (!this->glCaps().getRenderbufferFormat(config, &colorBufferFormat)) {
|
||||
return {};
|
||||
|
@ -139,8 +139,7 @@ public:
|
||||
bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override;
|
||||
void deleteTestingOnlyBackendTexture(const GrBackendTexture&) override;
|
||||
|
||||
GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType,
|
||||
GrSRGBEncoded) override;
|
||||
GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType) override;
|
||||
|
||||
void deleteTestingOnlyBackendRenderTarget(const GrBackendRenderTarget&) override;
|
||||
|
||||
|
@ -216,9 +216,8 @@ void GrMockGpu::deleteTestingOnlyBackendTexture(const GrBackendTexture& tex) {
|
||||
}
|
||||
|
||||
GrBackendRenderTarget GrMockGpu::createTestingOnlyBackendRenderTarget(int w, int h,
|
||||
GrColorType colorType,
|
||||
GrSRGBEncoded srgbEncoded) {
|
||||
auto config = GrColorTypeToPixelConfig(colorType, srgbEncoded);
|
||||
GrColorType colorType) {
|
||||
auto config = GrColorTypeToPixelConfig(colorType, GrSRGBEncoded::kNo);
|
||||
if (kUnknown_GrPixelConfig == config) {
|
||||
return {};
|
||||
}
|
||||
|
@ -110,8 +110,7 @@ private:
|
||||
bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override;
|
||||
void deleteTestingOnlyBackendTexture(const GrBackendTexture&) override;
|
||||
|
||||
GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType,
|
||||
GrSRGBEncoded) override;
|
||||
GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType) override;
|
||||
void deleteTestingOnlyBackendRenderTarget(const GrBackendRenderTarget&) override;
|
||||
|
||||
void testingOnly_flushGpuAndSync() override {}
|
||||
|
@ -61,8 +61,7 @@ public:
|
||||
|
||||
void deleteTestingOnlyBackendTexture(const GrBackendTexture&) override;
|
||||
|
||||
GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType,
|
||||
GrSRGBEncoded) override;
|
||||
GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType) override;
|
||||
|
||||
void deleteTestingOnlyBackendRenderTarget(const GrBackendRenderTarget&) override;
|
||||
|
||||
|
@ -510,12 +510,11 @@ void GrMtlGpu::deleteTestingOnlyBackendTexture(const GrBackendTexture& tex) {
|
||||
}
|
||||
}
|
||||
|
||||
GrBackendRenderTarget GrMtlGpu::createTestingOnlyBackendRenderTarget(int w, int h, GrColorType ct,
|
||||
GrSRGBEncoded srgbEncoded) {
|
||||
GrBackendRenderTarget GrMtlGpu::createTestingOnlyBackendRenderTarget(int w, int h, GrColorType ct) {
|
||||
if (w > this->caps()->maxRenderTargetSize() || h > this->caps()->maxRenderTargetSize()) {
|
||||
return GrBackendRenderTarget();
|
||||
}
|
||||
auto config = GrColorTypeToPixelConfig(ct, srgbEncoded);
|
||||
auto config = GrColorTypeToPixelConfig(ct, GrSRGBEncoded::kNo);
|
||||
if (kUnknown_GrPixelConfig == config) {
|
||||
return {};
|
||||
}
|
||||
|
@ -1420,15 +1420,14 @@ void GrVkGpu::deleteTestingOnlyBackendTexture(const GrBackendTexture& tex) {
|
||||
}
|
||||
}
|
||||
|
||||
GrBackendRenderTarget GrVkGpu::createTestingOnlyBackendRenderTarget(int w, int h, GrColorType ct,
|
||||
GrSRGBEncoded srgbEncoded) {
|
||||
GrBackendRenderTarget GrVkGpu::createTestingOnlyBackendRenderTarget(int w, int h, GrColorType ct) {
|
||||
if (w > this->caps()->maxRenderTargetSize() || h > this->caps()->maxRenderTargetSize()) {
|
||||
return GrBackendRenderTarget();
|
||||
}
|
||||
|
||||
this->handleDirtyContext();
|
||||
GrVkImageInfo info;
|
||||
auto config = GrColorTypeToPixelConfig(ct, srgbEncoded);
|
||||
auto config = GrColorTypeToPixelConfig(ct, GrSRGBEncoded::kNo);
|
||||
if (kUnknown_GrPixelConfig == config) {
|
||||
return {};
|
||||
}
|
||||
|
@ -77,8 +77,7 @@ public:
|
||||
bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override;
|
||||
void deleteTestingOnlyBackendTexture(const GrBackendTexture&) override;
|
||||
|
||||
GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType,
|
||||
GrSRGBEncoded) override;
|
||||
GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType) override;
|
||||
void deleteTestingOnlyBackendRenderTarget(const GrBackendRenderTarget&) override;
|
||||
|
||||
void testingOnly_flushGpuAndSync() override;
|
||||
|
@ -28,8 +28,7 @@ static sk_sp<GrSurfaceProxy> make_wrapped_rt(GrProxyProvider* provider,
|
||||
SkASSERT(1 == desc.fSampleCnt);
|
||||
GrSRGBEncoded srgbEncoded;
|
||||
auto ct = GrPixelConfigToColorTypeAndEncoding(desc.fConfig, &srgbEncoded);
|
||||
auto backendRT = gpu->createTestingOnlyBackendRenderTarget(desc.fWidth, desc.fHeight, ct,
|
||||
GrSRGBEncoded::kNo);
|
||||
auto backendRT = gpu->createTestingOnlyBackendRenderTarget(desc.fWidth, desc.fHeight, ct);
|
||||
return provider->wrapBackendRenderTarget(backendRT, origin);
|
||||
}
|
||||
|
||||
|
@ -209,8 +209,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WrappedProxyTest, reporter, ctxInfo) {
|
||||
// sample counts :(.
|
||||
if (ctxInfo.grContext()->colorTypeSupportedAsSurface(colorType)) {
|
||||
GrBackendRenderTarget backendRT = gpu->createTestingOnlyBackendRenderTarget(
|
||||
kWidthHeight, kWidthHeight, SkColorTypeToGrColorType(colorType),
|
||||
GrSRGBEncoded::kNo);
|
||||
kWidthHeight, kWidthHeight, SkColorTypeToGrColorType(colorType));
|
||||
sk_sp<GrSurfaceProxy> sProxy(
|
||||
proxyProvider->wrapBackendRenderTarget(backendRT, origin));
|
||||
check_surface(reporter, sProxy.get(), origin, kWidthHeight, kWidthHeight,
|
||||
|
Loading…
Reference in New Issue
Block a user