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

Side by Side Diff: content/browser/compositor/offscreen_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_OFFSCREEN_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H _ 5 #ifndef CONTENT_BROWSER_COMPOSITOR_OFFSCREEN_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H _
6 #define CONTENT_BROWSER_COMPOSITOR_OFFSCREEN_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H _ 6 #define CONTENT_BROWSER_COMPOSITOR_OFFSCREEN_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H _
7 7
8 #include "base/cancelable_callback.h" 8 #include "base/cancelable_callback.h"
9 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
10 #include "content/browser/compositor/browser_compositor_output_surface.h" 11 #include "content/browser/compositor/browser_compositor_output_surface.h"
11 12
12 namespace ui { 13 namespace ui {
13 class CompositorVSyncManager; 14 class CompositorVSyncManager;
14 } 15 }
15 16
16 namespace content { 17 namespace content {
17 class CommandBufferProxyImpl; 18 class CommandBufferProxyImpl;
19 class GLHelper;
20 class OwnedMailbox;
18 21
19 class OffscreenBrowserCompositorOutputSurface 22 class OffscreenBrowserCompositorOutputSurface
20 : public BrowserCompositorOutputSurface { 23 : public BrowserCompositorOutputSurface {
21 public: 24 public:
22 OffscreenBrowserCompositorOutputSurface( 25 OffscreenBrowserCompositorOutputSurface(
23 const scoped_refptr<ContextProviderCommandBuffer>& context, 26 const scoped_refptr<ContextProviderCommandBuffer>& context,
24 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, 27 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager,
25 scoped_ptr<BrowserCompositorOverlayCandidateValidator> 28 scoped_ptr<BrowserCompositorOverlayCandidateValidator>
26 overlay_candidate_validator); 29 overlay_candidate_validator);
27 30
28 ~OffscreenBrowserCompositorOutputSurface() override; 31 ~OffscreenBrowserCompositorOutputSurface() override;
29 32
30 protected: 33 protected:
31 // cc::OutputSurface: 34 // cc::OutputSurface:
32 void EnsureBackbuffer() override; 35 void EnsureBackbuffer() override;
33 void DiscardBackbuffer() override; 36 void DiscardBackbuffer() override;
34 void Reshape(const gfx::Size& size, float scale_factor) override; 37 void Reshape(const gfx::Size& size, float scale_factor) override;
35 void BindFramebuffer() override; 38 void BindFramebuffer() override;
36 void SwapBuffers(cc::CompositorFrame* frame) override; 39 void SwapBuffers(cc::CompositorFrame* frame) override;
37 40
41 // BrowserCompositorOutputSurface
42 scoped_refptr<OwnedMailbox> GetTextureMailbox() override;
43 base::Closure CreateCompositionStartedCallback() override;
38 #if defined(OS_MACOSX) 44 #if defined(OS_MACOSX)
39 void OnSurfaceDisplayed() override {}; 45 void OnSurfaceDisplayed() override {};
40 void SetSurfaceSuspendedForRecycle(bool suspended) override {}; 46 void SetSurfaceSuspendedForRecycle(bool suspended) override {};
41 bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const override; 47 bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const override;
42 #endif 48 #endif
43 49
44 uint32 fbo_; 50 uint32 fbo_;
45 bool is_backbuffer_discarded_; 51 bool is_backbuffer_discarded_;
46 uint32 backing_texture_id_; 52 uint32 backing_texture_id_;
53 bool needs_update_reflector_;
54
55 scoped_refptr<OwnedMailbox> mailbox_;
56 scoped_ptr<GLHelper> offline_compositor_gl_helper_;
47 57
48 base::WeakPtrFactory<OffscreenBrowserCompositorOutputSurface> 58 base::WeakPtrFactory<OffscreenBrowserCompositorOutputSurface>
49 weak_ptr_factory_; 59 weak_ptr_factory_;
50 60
51 private: 61 private:
52 DISALLOW_COPY_AND_ASSIGN(OffscreenBrowserCompositorOutputSurface); 62 DISALLOW_COPY_AND_ASSIGN(OffscreenBrowserCompositorOutputSurface);
53 }; 63 };
54 64
55 } // namespace content 65 } // namespace content
56 66
57 #endif // CONTENT_BROWSER_COMPOSITOR_OFFSCREEN_BROWSER_COMPOSITOR_OUTPUT_SURFAC E_H_ 67 #endif // CONTENT_BROWSER_COMPOSITOR_OFFSCREEN_BROWSER_COMPOSITOR_OUTPUT_SURFAC E_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698