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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_DELEGATING_OUTPUT_SURFACE_H_
6 #define BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_DELEGATING_OUTPUT_SURFACE_H_
7
8 #include "cc/output/output_surface.h"
9 #include "cc/output/renderer_settings.h"
10 #include "cc/scheduler/begin_frame_source.h"
11 #include "cc/surfaces/display.h"
12 #include "cc/surfaces/display_client.h"
13 #include "cc/surfaces/surface_factory.h"
14 #include "cc/surfaces/surface_factory_client.h"
15 #include "cc/surfaces/surface_id_allocator.h"
16 #include "cc/surfaces/surface_manager.h"
17
18 namespace blimp {
19 namespace client {
20
21 class BlimpDelegatingOutputSurface : public cc::OutputSurface,
22 public cc::SurfaceFactoryClient,
23 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
24 public:
25 BlimpDelegatingOutputSurface(
26 scoped_refptr<cc::ContextProvider> compositor_context_provider,
27 scoped_refptr<cc::ContextProvider> worker_context_provider,
28 std::unique_ptr<cc::OutputSurface> display_output_surface,
29 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
30 const cc::RendererSettings& renderer_settings,
31 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
32 ~BlimpDelegatingOutputSurface() override;
33
34 // OutputSurface implementation.
35 bool BindToClient(cc::OutputSurfaceClient* client) override;
36 void DetachFromClient() override;
37 void SwapBuffers(cc::CompositorFrame frame) override;
38 void ForceReclaimResources() override;
39 void BindFramebuffer() override;
40 uint32_t GetFramebufferCopyTextureFormat() override;
41
42 // SurfaceFactoryClient implementation.
43 void ReturnResources(const cc::ReturnedResourceArray& resources) override;
44 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override;
45
46 // DisplayClient implementation.
47 void DisplayOutputSurfaceLost() override;
48 void DisplaySetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override;
49 void DisplayWillDrawAndSwap(bool will_draw_and_swap,
50 const cc::RenderPassList& render_passes) override;
51 void DisplayDidDrawAndSwap() override;
52
53 private:
54 // 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
55 // is owned/destroyed on the compositor thread.
56 std::unique_ptr<cc::SurfaceManager> surface_manager_;
57 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_;
58 cc::SurfaceId delegated_surface_id_;
59
60 // Uses surface_manager_.
61 std::unique_ptr<cc::SurfaceFactory> surface_factory_;
62
63 // Uses surface_manager_.
64 std::unique_ptr<cc::Display> display_;
65 };
66
67 } // namespace client
68 } // namespace blimp
69
70 #endif // BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_DELEGATING_OUTPUT_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698