| OLD | NEW | 
|---|
| 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 <stdint.h> | 8 #include <stdint.h> | 
| 9 | 9 | 
| 10 #include <memory> | 10 #include <memory> | 
| (...skipping 17 matching lines...) Expand all  Loading... | 
| 28  public: | 28  public: | 
| 29   OffscreenBrowserCompositorOutputSurface( | 29   OffscreenBrowserCompositorOutputSurface( | 
| 30       scoped_refptr<ContextProviderCommandBuffer> context, | 30       scoped_refptr<ContextProviderCommandBuffer> context, | 
| 31       scoped_refptr<ui::CompositorVSyncManager> vsync_manager, | 31       scoped_refptr<ui::CompositorVSyncManager> vsync_manager, | 
| 32       cc::SyntheticBeginFrameSource* begin_frame_source, | 32       cc::SyntheticBeginFrameSource* begin_frame_source, | 
| 33       std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> | 33       std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> | 
| 34           overlay_candidate_validator); | 34           overlay_candidate_validator); | 
| 35 | 35 | 
| 36   ~OffscreenBrowserCompositorOutputSurface() override; | 36   ~OffscreenBrowserCompositorOutputSurface() override; | 
| 37 | 37 | 
| 38  protected: | 38  private: | 
| 39   // cc::OutputSurface: | 39   // cc::OutputSurface implementation. | 
|  | 40   void BindToClient(cc::OutputSurfaceClient* client) override; | 
| 40   void EnsureBackbuffer() override; | 41   void EnsureBackbuffer() override; | 
| 41   void DiscardBackbuffer() override; | 42   void DiscardBackbuffer() override; | 
| 42   void Reshape(const gfx::Size& size, | 43   void Reshape(const gfx::Size& size, | 
| 43                float scale_factor, | 44                float scale_factor, | 
| 44                const gfx::ColorSpace& color_space, | 45                const gfx::ColorSpace& color_space, | 
| 45                bool alpha) override; | 46                bool alpha) override; | 
| 46   void BindFramebuffer() override; | 47   void BindFramebuffer() override; | 
| 47   void SwapBuffers(cc::OutputSurfaceFrame frame) override; | 48   void SwapBuffers(cc::OutputSurfaceFrame frame) override; | 
| 48   bool IsDisplayedAsOverlayPlane() const override; | 49   bool IsDisplayedAsOverlayPlane() const override; | 
| 49   unsigned GetOverlayTextureId() const override; | 50   unsigned GetOverlayTextureId() const override; | 
| 50   bool SurfaceIsSuspendForRecycle() const override; | 51   bool SurfaceIsSuspendForRecycle() const override; | 
| 51   uint32_t GetFramebufferCopyTextureFormat() override; | 52   uint32_t GetFramebufferCopyTextureFormat() override; | 
| 52 | 53 | 
| 53   // BrowserCompositorOutputSurface | 54   // BrowserCompositorOutputSurface implementation. | 
| 54   void OnReflectorChanged() override; | 55   void OnReflectorChanged() override; | 
| 55 #if defined(OS_MACOSX) | 56 #if defined(OS_MACOSX) | 
| 56   void SetSurfaceSuspendedForRecycle(bool suspended) override {}; | 57   void SetSurfaceSuspendedForRecycle(bool suspended) override {}; | 
| 57 #endif | 58 #endif | 
| 58 | 59 | 
|  | 60   void OnSwapBuffersComplete(); | 
|  | 61 | 
|  | 62   cc::OutputSurfaceClient* client_ = nullptr; | 
| 59   gfx::Size reshape_size_; | 63   gfx::Size reshape_size_; | 
| 60   uint32_t fbo_ = 0; | 64   uint32_t fbo_ = 0; | 
| 61   bool reflector_changed_ = false; | 65   bool reflector_changed_ = false; | 
| 62   std::unique_ptr<ReflectorTexture> reflector_texture_; | 66   std::unique_ptr<ReflectorTexture> reflector_texture_; | 
| 63 |  | 
| 64   base::WeakPtrFactory<OffscreenBrowserCompositorOutputSurface> | 67   base::WeakPtrFactory<OffscreenBrowserCompositorOutputSurface> | 
| 65       weak_ptr_factory_; | 68       weak_ptr_factory_; | 
| 66 | 69 | 
| 67  private: |  | 
| 68   void OnSwapBuffersComplete(); |  | 
| 69 |  | 
| 70   DISALLOW_COPY_AND_ASSIGN(OffscreenBrowserCompositorOutputSurface); | 70   DISALLOW_COPY_AND_ASSIGN(OffscreenBrowserCompositorOutputSurface); | 
| 71 }; | 71 }; | 
| 72 | 72 | 
| 73 }  // namespace content | 73 }  // namespace content | 
| 74 | 74 | 
| 75 #endif  // CONTENT_BROWSER_COMPOSITOR_OFFSCREEN_BROWSER_COMPOSITOR_OUTPUT_SURFAC
    E_H_ | 75 #endif  // CONTENT_BROWSER_COMPOSITOR_OFFSCREEN_BROWSER_COMPOSITOR_OUTPUT_SURFAC
    E_H_ | 
| OLD | NEW | 
|---|