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

Unified Diff: blimp/client/feature/compositor/blimp_delegating_output_surface.h

Issue 2242653002: blimp: Make Blimp client use a Display for compositing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: blimpdisplay: . Created 4 years, 4 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: blimp/client/feature/compositor/blimp_delegating_output_surface.h
diff --git a/blimp/client/feature/compositor/blimp_delegating_output_surface.h b/blimp/client/feature/compositor/blimp_delegating_output_surface.h
new file mode 100644
index 0000000000000000000000000000000000000000..0a69ef02380b6159ae93f3d203e2f4005820409a
--- /dev/null
+++ b/blimp/client/feature/compositor/blimp_delegating_output_surface.h
@@ -0,0 +1,70 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_DELEGATING_OUTPUT_SURFACE_H_
+#define BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_DELEGATING_OUTPUT_SURFACE_H_
+
+#include "cc/output/output_surface.h"
+#include "cc/output/renderer_settings.h"
+#include "cc/scheduler/begin_frame_source.h"
+#include "cc/surfaces/display.h"
+#include "cc/surfaces/display_client.h"
+#include "cc/surfaces/surface_factory.h"
+#include "cc/surfaces/surface_factory_client.h"
+#include "cc/surfaces/surface_id_allocator.h"
+#include "cc/surfaces/surface_manager.h"
+
+namespace blimp {
+namespace client {
+
+class BlimpDelegatingOutputSurface : public cc::OutputSurface,
+ public cc::SurfaceFactoryClient,
+ public cc::DisplayClient {
Wez 2016/08/12 01:56:49 Can we add a brief comment to explain what this is
danakj 2016/08/12 18:16:53 It's a delegating output surface that delegates co
+ public:
+ BlimpDelegatingOutputSurface(
+ scoped_refptr<cc::ContextProvider> compositor_context_provider,
+ scoped_refptr<cc::ContextProvider> worker_context_provider,
+ std::unique_ptr<cc::OutputSurface> display_output_surface,
+ gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
Wez 2016/08/12 01:56:50 Is this ref-counted, or passing ownership? If neit
danakj 2016/08/12 18:16:53 Neither, it's a raw pointer which are not ownershi
Wez 2016/08/18 23:22:40 Right, now that we have unique_ptr and scoped_refp
+ const cc::RendererSettings& renderer_settings,
+ base::SingleThreadTaskRunner* task_runner);
Wez 2016/08/12 01:56:50 nit: const scoped_refptr<>& for clarity here.
danakj 2016/08/12 18:16:53 So, the stuff it passes the task_runner to don't t
danakj 2016/08/12 18:17:53 (It should actually be taking a scoped_refptr here
Wez 2016/08/18 23:22:40 It's not so much whether the ctor takes a referenc
+ ~BlimpDelegatingOutputSurface() override;
+
+ // OutputSurface implementation.
+ bool BindToClient(cc::OutputSurfaceClient* client) override;
+ void DetachFromClient() override;
+ void SwapBuffers(cc::CompositorFrame frame) override;
+ void ForceReclaimResources() override;
+ void BindFramebuffer() override;
+ uint32_t GetFramebufferCopyTextureFormat() override;
+
+ // SurfaceFactoryClient implementation.
+ void ReturnResources(const cc::ReturnedResourceArray& resources) override;
+ void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override;
+
+ // DisplayClient implementation.
+ void DisplayOutputSurfaceLost() override;
+ void DisplaySetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override;
+ void DisplayWillDrawAndSwap(bool will_draw_and_swap,
+ const cc::RenderPassList& render_passes) override;
+ void DisplayDidDrawAndSwap() override;
+
+ private:
+ // TODO(danakj): These don't to be stored in unique_ptrs when OutputSurface
Wez 2016/08/12 01:56:49 You mean "don't need to be..." or something else?
danakj 2016/08/12 18:16:53 Ya, woops, that's in the original place I copied t
+ // is owned/destroyed on the compositor thread.
+ std::unique_ptr<cc::SurfaceManager> surface_manager_;
+ std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_;
+ cc::SurfaceId delegated_surface_id_;
+
+ // Uses surface_manager_.
+ std::unique_ptr<cc::SurfaceFactory> surface_factory_;
+
+ // Uses surface_manager_.
+ std::unique_ptr<cc::Display> display_;
+};
+
+} // namespace client
+} // namespace blimp
+
+#endif // BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_DELEGATING_OUTPUT_SURFACE_H_

Powered by Google App Engine
This is Rietveld 408576698