Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Unified Diff: content/renderer/gpu/mailbox_output_surface.h

Issue 2002303002: Consolidate OutputSurface constructors into GL vs Vulkan. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: outputsurface-constructors: rebase-and-fixcrash Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/gpu/mailbox_output_surface.h
diff --git a/content/renderer/gpu/mailbox_output_surface.h b/content/renderer/gpu/mailbox_output_surface.h
index 1d4b95559f84b82270f2da3326efd300600588f8..f9c4b80558d6be838e0069dbf33c2823d111de3f 100644
--- a/content/renderer/gpu/mailbox_output_surface.h
+++ b/content/renderer/gpu/mailbox_output_surface.h
@@ -11,13 +11,15 @@
#include <queue>
#include "base/memory/ref_counted.h"
+#include "cc/output/output_surface.h"
#include "cc/resources/resource_format.h"
#include "cc/resources/transferable_resource.h"
-#include "content/renderer/gpu/compositor_output_surface.h"
#include "ui/gfx/geometry/size.h"
namespace cc {
class CompositorFrameAck;
+class ContextProvider;
+class GLFrameData;
}
namespace content {
@@ -27,19 +29,16 @@ class FrameSwapMessageQueue;
// are sent to the browser through the mailbox extension.
// This class can be created only on the main thread, but then becomes pinned
// to a fixed thread when bindToClient is called.
-class MailboxOutputSurface : public CompositorOutputSurface {
+class MailboxOutputSurface : public cc::OutputSurface {
public:
MailboxOutputSurface(
- int32_t routing_id,
uint32_t output_surface_id,
- const scoped_refptr<ContextProviderCommandBuffer>& context_provider,
- const scoped_refptr<ContextProviderCommandBuffer>&
- worker_context_provider,
- scoped_refptr<FrameSwapMessageQueue> swap_frame_message_queue,
- cc::ResourceFormat format);
+ scoped_refptr<cc::ContextProvider> context_provider,
+ scoped_refptr<cc::ContextProvider> worker_context_provider);
~MailboxOutputSurface() override;
// cc::OutputSurface implementation.
+ bool BindToClient(cc::OutputSurfaceClient* client) override;
void DetachFromClient() override;
void EnsureBackbuffer() override;
void DiscardBackbuffer() override;
@@ -48,9 +47,9 @@ class MailboxOutputSurface : public CompositorOutputSurface {
void SwapBuffers(cc::CompositorFrame* frame) override;
private:
- // CompositorOutputSurface overrides.
- void OnSwapAck(uint32_t output_surface_id,
- const cc::CompositorFrameAck& ack) override;
+ void ShortcutSwapAck(uint32_t output_surface_id,
+ std::unique_ptr<cc::GLFrameData> gl_frame_data);
+ void OnSwapAck(uint32_t output_surface_id, const cc::CompositorFrameAck& ack);
size_t GetNumAcksPending();
@@ -66,13 +65,17 @@ class MailboxOutputSurface : public CompositorOutputSurface {
gfx::Size size;
};
+ const uint32_t output_surface_id_;
+
TransferableFrame current_backing_;
std::deque<TransferableFrame> pending_textures_;
std::queue<TransferableFrame> returned_textures_;
uint32_t fbo_;
bool is_backbuffer_discarded_;
- cc::ResourceFormat format_;
+
+ std::unique_ptr<cc::CompositorFrameAck> previous_frame_ack_;
+ base::WeakPtrFactory<MailboxOutputSurface> weak_ptrs_;
};
} // namespace content
« no previous file with comments | « content/renderer/gpu/delegated_compositor_output_surface.cc ('k') | content/renderer/gpu/mailbox_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698