Commit b79641af authored by Antoine Labour's avatar Antoine Labour Committed by Commit Bot

Port PepperGraphics2DHost to shared images

Bug: 945009
Change-Id: Iac5a5b59dfc5100e8c47a1c46ec9c586eacfe88c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1536347Reviewed-by: default avatardanakj <danakj@chromium.org>
Commit-Queue: Antoine Labour <piman@chromium.org>
Auto-Submit: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644830}
parent 9e568ff3
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "cc/resources/shared_bitmap_id_registrar.h" #include "cc/resources/shared_bitmap_id_registrar.h"
#include "content/common/content_export.h" #include "content/common/content_export.h"
#include "gpu/command_buffer/common/mailbox.h" #include "gpu/command_buffer/common/mailbox.h"
#include "gpu/command_buffer/common/sync_token.h"
#include "ppapi/c/ppb_graphics_2d.h" #include "ppapi/c/ppb_graphics_2d.h"
#include "ppapi/host/host_message_context.h" #include "ppapi/host/host_message_context.h"
#include "ppapi/host/resource_host.h" #include "ppapi/host/resource_host.h"
...@@ -31,10 +32,6 @@ namespace gfx { ...@@ -31,10 +32,6 @@ namespace gfx {
class Rect; class Rect;
} }
namespace gpu {
struct SyncToken;
}
namespace viz { namespace viz {
class ContextProvider; class ContextProvider;
class SingleReleaseCallback; class SingleReleaseCallback;
...@@ -189,7 +186,8 @@ class CONTENT_EXPORT PepperGraphics2DHost ...@@ -189,7 +186,8 @@ class CONTENT_EXPORT PepperGraphics2DHost
static void ReleaseTextureCallback( static void ReleaseTextureCallback(
base::WeakPtr<PepperGraphics2DHost> host, base::WeakPtr<PepperGraphics2DHost> host,
scoped_refptr<viz::ContextProvider> context, scoped_refptr<viz::ContextProvider> context,
uint32_t id, const gfx::Size& size,
const gpu::Mailbox& mailbox,
const gpu::SyncToken& sync_token, const gpu::SyncToken& sync_token,
bool lost); bool lost);
...@@ -237,19 +235,17 @@ class CONTENT_EXPORT PepperGraphics2DHost ...@@ -237,19 +235,17 @@ class CONTENT_EXPORT PepperGraphics2DHost
// The shared main thread context provider, used to upload 2d pepper frames // The shared main thread context provider, used to upload 2d pepper frames
// if the compositor is expecting gpu content. // if the compositor is expecting gpu content.
scoped_refptr<viz::ContextProvider> main_thread_context_; scoped_refptr<viz::ContextProvider> main_thread_context_;
struct TextureInfo { struct SharedImageInfo {
uint32_t id; SharedImageInfo(gpu::SyncToken sync_token,
gpu::Mailbox mailbox,
gfx::Size size)
: sync_token(sync_token), mailbox(mailbox), size(size) {}
gpu::SyncToken sync_token;
gpu::Mailbox mailbox; gpu::Mailbox mailbox;
gfx::Size size; gfx::Size size;
}; };
// The ids of textures holding the copied contents of software frames to // Shared images that are available for recycling.
// give to the compositor via GL. Textures in this list are in use by the std::vector<SharedImageInfo> recycled_shared_images_;
// compositor and are treated as owned by the compositor until the
// ReleaseTextureCallback() informs otherwise.
std::vector<TextureInfo> texture_copies_;
// Texture ids move from |texture_copies_| to here once they are available for
// reuse.
std::vector<TextureInfo> recycled_texture_copies_;
// This is a bitmap that was recently released by the compositor and may be // This is a bitmap that was recently released by the compositor and may be
// used to transfer bytes to the compositor again, along with the registration // used to transfer bytes to the compositor again, along with the registration
......
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