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;