Enable creating protected vulkan backend
This CL allows user to indicate that they have a protected content in
GrVkBackendContext creation which results in protected CommandPool and Queue
usage.
Bug: skia:9016
Change-Id: I6a478d688b6988c2c5e5e98f18f58fb21f9d26ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210067
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Emircan Uysaler <emircan@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 2226247..9cf02d7 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -320,7 +320,8 @@
GrBackendTexture GrContext::createBackendTexture(int width, int height,
const GrBackendFormat& backendFormat,
GrMipMapped mipMapped,
- GrRenderable renderable) {
+ GrRenderable renderable,
+ GrProtected isProtected) {
if (!this->asDirectContext()) {
return GrBackendTexture();
}
@@ -335,13 +336,14 @@
return fGpu->createBackendTexture(width, height, backendFormat,
mipMapped, renderable,
- nullptr, 0, nullptr);
+ nullptr, 0, nullptr, isProtected);
}
GrBackendTexture GrContext::createBackendTexture(int width, int height,
SkColorType colorType,
GrMipMapped mipMapped,
- GrRenderable renderable) {
+ GrRenderable renderable,
+ GrProtected isProtected) {
if (!this->asDirectContext()) {
return GrBackendTexture();
}
@@ -355,7 +357,7 @@
return GrBackendTexture();
}
- return this->createBackendTexture(width, height, format, mipMapped, renderable);
+ return this->createBackendTexture(width, height, format, mipMapped, renderable, isProtected);
}
GrBackendTexture GrContext::createBackendTexture(int width, int height,
@@ -377,7 +379,7 @@
return fGpu->createBackendTexture(width, height, backendFormat,
mipMapped, renderable,
- nullptr, 0, &color);
+ nullptr, 0, &color, GrProtected::kNo);
}
GrBackendTexture GrContext::createBackendTexture(int width, int height,