Commit 10521119 authored by Paulo Warren's avatar Paulo Warren Committed by Commit Bot

gpu: Implement ProduceSkia for ozone shared images

This CL begins the work of adding a Skia usable shared image created via
a Ozone surface factory. ProduceSkia is able to be used in a GL context
but the Vulkan path is not complete yet.

Bug: 1023997
Change-Id: I83432a7a9e265a691adb9d1139bb31a1aafe33b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2067448
Commit-Queue: Paulo Warren <pwarren@chromium.org>
Reviewed-by: default avatarAndres Calderon Jaramillo <andrescj@chromium.org>
Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751723}
parent 282cd8a0
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "gpu/command_buffer/service/shared_image_manager.h" #include "gpu/command_buffer/service/shared_image_manager.h"
#include "gpu/command_buffer/service/shared_image_representation.h" #include "gpu/command_buffer/service/shared_image_representation.h"
#include "gpu/command_buffer/service/shared_image_representation_gl_ozone.h" #include "gpu/command_buffer/service/shared_image_representation_gl_ozone.h"
#include "gpu/command_buffer/service/shared_image_representation_skia_gl.h"
#include "gpu/vulkan/vulkan_device_queue.h" #include "gpu/vulkan/vulkan_device_queue.h"
#include "ui/gfx/buffer_format_util.h" #include "ui/gfx/buffer_format_util.h"
#include "ui/gfx/buffer_types.h" #include "ui/gfx/buffer_types.h"
...@@ -144,6 +145,23 @@ SharedImageBackingOzone::ProduceSkia( ...@@ -144,6 +145,23 @@ SharedImageBackingOzone::ProduceSkia(
SharedImageManager* manager, SharedImageManager* manager,
MemoryTypeTracker* tracker, MemoryTypeTracker* tracker,
scoped_refptr<SharedContextState> context_state) { scoped_refptr<SharedContextState> context_state) {
if (context_state->GrContextIsGL()) {
auto gl_representation = ProduceGLTexture(manager, tracker);
if (!gl_representation) {
LOG(ERROR) << "SharedImageBackingOzone::ProduceSkia failed to create GL "
"representation";
return nullptr;
}
auto skia_representation = SharedImageRepresentationSkiaGL::Create(
std::move(gl_representation), std::move(context_state), manager, this,
tracker);
if (!skia_representation) {
LOG(ERROR) << "SharedImageBackingOzone::ProduceSkia failed to create "
"Skia representation";
return nullptr;
}
return skia_representation;
}
NOTIMPLEMENTED_LOG_ONCE(); NOTIMPLEMENTED_LOG_ONCE();
return nullptr; return nullptr;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment