Make color initialization version of createBackendTexture public
Mechanical.
Change-Id: I48be78a12684fc5243ee509e391984daa190fb7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218182
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index d6bc93c..054456f 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -392,6 +392,49 @@
return this->createBackendTexture(width, height, format, mipMapped, renderable);
}
+GrBackendTexture GrContext::createBackendTexture(int width, int height,
+ GrBackendFormat backendFormat,
+ const SkColor4f& color,
+ GrMipMapped mipMapped,
+ GrRenderable renderable) {
+ if (!this->asDirectContext()) {
+ return GrBackendTexture();
+ }
+
+ if (this->abandoned()) {
+ return GrBackendTexture();
+ }
+
+ if (!backendFormat.isValid()) {
+ return GrBackendTexture();
+ }
+
+ return fGpu->createBackendTexture(width, height, backendFormat,
+ mipMapped, renderable,
+ nullptr, 0, color);
+}
+
+GrBackendTexture GrContext::createBackendTexture(int width, int height,
+ SkColorType colorType,
+ const SkColor4f& color,
+ GrMipMapped mipMapped,
+ GrRenderable renderable) {
+ if (!this->asDirectContext()) {
+ return GrBackendTexture();
+ }
+
+ if (this->abandoned()) {
+ return GrBackendTexture();
+ }
+
+ GrBackendFormat format = this->caps()->getBackendFormatFromColorType(colorType);
+ if (!format.isValid()) {
+ return GrBackendTexture();
+ }
+
+ return this->createBackendTexture(width, height, format, color, mipMapped, renderable);
+}
+
void GrContext::deleteBackendTexture(GrBackendTexture backendTex) {
if (this->abandoned() || !backendTex.isValid()) {
return;
diff --git a/src/gpu/GrContextPriv.cpp b/src/gpu/GrContextPriv.cpp
index 2ab6822..6a482d1 100644
--- a/src/gpu/GrContextPriv.cpp
+++ b/src/gpu/GrContextPriv.cpp
@@ -760,48 +760,3 @@
fContext->drawingManager()->testingOnly_removeOnFlushCallbackObject(cb);
}
#endif
-
-//////////////////////////////////////////////////////////////////////////////
-GrBackendTexture GrContextPriv::createBackendTexture(int width, int height,
- GrBackendFormat backendFormat,
- const SkColor4f& color,
- GrMipMapped mipMapped,
- GrRenderable renderable) {
- if (!fContext->asDirectContext()) {
- return GrBackendTexture();
- }
-
- if (this->abandoned()) {
- return GrBackendTexture();
- }
-
- if (!backendFormat.isValid()) {
- return GrBackendTexture();
- }
-
- GrGpu* gpu = fContext->fGpu.get();
-
- return gpu->createBackendTexture(width, height, backendFormat,
- mipMapped, renderable, nullptr, 0, color);
-}
-
-GrBackendTexture GrContextPriv::createBackendTexture(int width, int height,
- SkColorType colorType,
- const SkColor4f& color,
- GrMipMapped mipMapped,
- GrRenderable renderable) {
- if (!fContext->asDirectContext()) {
- return GrBackendTexture();
- }
-
- if (this->abandoned()) {
- return GrBackendTexture();
- }
-
- GrBackendFormat format = fContext->caps()->getBackendFormatFromColorType(colorType);
- if (!format.isValid()) {
- return GrBackendTexture();
- }
-
- return this->createBackendTexture(width, height, format, color, mipMapped, renderable);
-}
diff --git a/src/gpu/GrContextPriv.h b/src/gpu/GrContextPriv.h
index 5dbb038..86af1f3 100644
--- a/src/gpu/GrContextPriv.h
+++ b/src/gpu/GrContextPriv.h
@@ -292,20 +292,6 @@
void testingOnly_flushAndRemoveOnFlushCallbackObject(GrOnFlushCallbackObject*);
#endif
- // If possible, create a backend texture initialized to a particular color. The client should
- // ensure that the returned backend texture is valid.
- GrBackendTexture createBackendTexture(int width, int height,
- GrBackendFormat, const SkColor4f& color,
- GrMipMapped, GrRenderable);
-
- // If possible, create a backend texture initialized to a particular color. The client should
- // ensure that the returned backend texture is valid.
- // If successful, the created backend texture will be compatible with the provided
- // SkColorType.
- GrBackendTexture createBackendTexture(int width, int height,
- SkColorType, const SkColor4f& color,
- GrMipMapped, GrRenderable);
-
private:
explicit GrContextPriv(GrContext* context) : fContext(context) {}
GrContextPriv(const GrContextPriv&); // unimpl