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

Side by Side Diff: content/browser/compositor/browser_compositor_output_surface.h

Issue 1123763003: Draw the offscreen texture to reflector's surface without extra copy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ 5 #ifndef CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
6 #define CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ 6 #define CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
7 7
8 #include "base/threading/non_thread_safe.h" 8 #include "base/threading/non_thread_safe.h"
9 #include "cc/output/output_surface.h" 9 #include "cc/output/output_surface.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "ui/compositor/compositor_vsync_manager.h" 11 #include "ui/compositor/compositor_vsync_manager.h"
12 12
13 namespace cc { 13 namespace cc {
14 class SoftwareOutputDevice; 14 class SoftwareOutputDevice;
15 } 15 }
16 16
17 namespace content { 17 namespace content {
18 class BrowserCompositorOverlayCandidateValidator; 18 class BrowserCompositorOverlayCandidateValidator;
19 class ContextProviderCommandBuffer; 19 class ContextProviderCommandBuffer;
20 class ReflectorImpl; 20 class ReflectorImpl;
21 class WebGraphicsContext3DCommandBufferImpl; 21 class WebGraphicsContext3DCommandBufferImpl;
22 class OwnedMailbox;
22 23
23 class CONTENT_EXPORT BrowserCompositorOutputSurface 24 class CONTENT_EXPORT BrowserCompositorOutputSurface
24 : public cc::OutputSurface, 25 : public cc::OutputSurface,
25 public ui::CompositorVSyncManager::Observer { 26 public ui::CompositorVSyncManager::Observer {
26 public: 27 public:
27 ~BrowserCompositorOutputSurface() override; 28 ~BrowserCompositorOutputSurface() override;
28 29
29 // cc::OutputSurface implementation. 30 // cc::OutputSurface implementation.
30 bool BindToClient(cc::OutputSurfaceClient* client) override; 31 bool BindToClient(cc::OutputSurfaceClient* client) override;
31 cc::OverlayCandidateValidator* GetOverlayCandidateValidator() const override; 32 cc::OverlayCandidateValidator* GetOverlayCandidateValidator() const override;
32 33
33 // ui::CompositorOutputSurface::Observer implementation. 34 // ui::CompositorOutputSurface::Observer implementation.
34 void OnUpdateVSyncParameters(base::TimeTicks timebase, 35 void OnUpdateVSyncParameters(base::TimeTicks timebase,
35 base::TimeDelta interval) override; 36 base::TimeDelta interval) override;
36 37
37 void OnUpdateVSyncParametersFromGpu(base::TimeTicks tiembase, 38 void OnUpdateVSyncParametersFromGpu(base::TimeTicks tiembase,
38 base::TimeDelta interval); 39 base::TimeDelta interval);
39 40
40 void SetReflector(ReflectorImpl* reflector); 41 void SetReflector(ReflectorImpl* reflector);
41 42
43 // Returns a mailbox that holds the texture used for offscreen
44 // output surface. nullptr if the output surface isn't offscreen
45 // surface.
46 virtual scoped_refptr<OwnedMailbox> GetTextureMailbox();
47
48 // Returns a callback that will be called when all mirroring
49 // compositors have started composition.
50 virtual base::Closure CreateCompositionStartedCallback();
51
42 #if defined(OS_MACOSX) 52 #if defined(OS_MACOSX)
43 virtual void OnSurfaceDisplayed() = 0; 53 virtual void OnSurfaceDisplayed() = 0;
44 virtual void SetSurfaceSuspendedForRecycle(bool suspended) = 0; 54 virtual void SetSurfaceSuspendedForRecycle(bool suspended) = 0;
45 virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const = 0; 55 virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const = 0;
46 #endif 56 #endif
47 57
48 protected: 58 protected:
49 // Constructor used by the accelerated implementation. 59 // Constructor used by the accelerated implementation.
50 BrowserCompositorOutputSurface( 60 BrowserCompositorOutputSurface(
51 const scoped_refptr<cc::ContextProvider>& context, 61 const scoped_refptr<cc::ContextProvider>& context,
(...skipping 14 matching lines...) Expand all
66 76
67 scoped_ptr<BrowserCompositorOverlayCandidateValidator> 77 scoped_ptr<BrowserCompositorOverlayCandidateValidator>
68 overlay_candidate_validator_; 78 overlay_candidate_validator_;
69 79
70 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface); 80 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface);
71 }; 81 };
72 82
73 } // namespace content 83 } // namespace content
74 84
75 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ 85 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698