| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE
_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE
_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE
_H_ | 6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURFACE
_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 class SynchronousCompositorOutputSurface | 52 class SynchronousCompositorOutputSurface |
| 53 : NON_EXPORTED_BASE(public cc::OutputSurface) { | 53 : NON_EXPORTED_BASE(public cc::OutputSurface) { |
| 54 public: | 54 public: |
| 55 explicit SynchronousCompositorOutputSurface(int routing_id); | 55 explicit SynchronousCompositorOutputSurface(int routing_id); |
| 56 virtual ~SynchronousCompositorOutputSurface(); | 56 virtual ~SynchronousCompositorOutputSurface(); |
| 57 | 57 |
| 58 // OutputSurface. | 58 // OutputSurface. |
| 59 virtual bool ForcedDrawToSoftwareDevice() const OVERRIDE; | 59 virtual bool ForcedDrawToSoftwareDevice() const OVERRIDE; |
| 60 virtual bool BindToClient(cc::OutputSurfaceClient* surface_client) OVERRIDE; | 60 virtual bool BindToClient(cc::OutputSurfaceClient* surface_client) OVERRIDE; |
| 61 virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE; | 61 virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE; |
| 62 virtual void SetNeedsBeginImplFrame(bool enable) OVERRIDE; | 62 virtual void SetNeedsBeginFrame(bool enable) OVERRIDE; |
| 63 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE; | 63 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE; |
| 64 | 64 |
| 65 // Partial SynchronousCompositor API implementation. | 65 // Partial SynchronousCompositor API implementation. |
| 66 bool InitializeHwDraw( | 66 bool InitializeHwDraw( |
| 67 scoped_refptr<cc::ContextProvider> onscreen_context_provider, | 67 scoped_refptr<cc::ContextProvider> onscreen_context_provider, |
| 68 scoped_refptr<cc::ContextProvider> offscreen_context_provider); | 68 scoped_refptr<cc::ContextProvider> offscreen_context_provider); |
| 69 void ReleaseHwDraw(); | 69 void ReleaseHwDraw(); |
| 70 bool DemandDrawHw(gfx::Size surface_size, | 70 bool DemandDrawHw(gfx::Size surface_size, |
| 71 const gfx::Transform& transform, | 71 const gfx::Transform& transform, |
| 72 gfx::Rect viewport, | 72 gfx::Rect viewport, |
| 73 gfx::Rect clip, | 73 gfx::Rect clip, |
| 74 bool stencil_enabled); | 74 bool stencil_enabled); |
| 75 bool DemandDrawSw(SkCanvas* canvas); | 75 bool DemandDrawSw(SkCanvas* canvas); |
| 76 void SetMemoryPolicy(const SynchronousCompositorMemoryPolicy& policy); | 76 void SetMemoryPolicy(const SynchronousCompositorMemoryPolicy& policy); |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 class SoftwareDevice; | 79 class SoftwareDevice; |
| 80 friend class SoftwareDevice; | 80 friend class SoftwareDevice; |
| 81 | 81 |
| 82 // Private OutputSurface overrides. | 82 // Private OutputSurface overrides. |
| 83 virtual void PostCheckForRetroactiveBeginImplFrame() OVERRIDE; | 83 virtual void PostCheckForRetroactiveBeginFrame() OVERRIDE; |
| 84 | 84 |
| 85 void InvokeComposite(const gfx::Transform& transform, | 85 void InvokeComposite(const gfx::Transform& transform, |
| 86 gfx::Rect viewport, | 86 gfx::Rect viewport, |
| 87 gfx::Rect clip, | 87 gfx::Rect clip, |
| 88 bool valid_for_tile_management); | 88 bool valid_for_tile_management); |
| 89 bool CalledOnValidThread() const; | 89 bool CalledOnValidThread() const; |
| 90 SynchronousCompositorOutputSurfaceDelegate* GetDelegate(); | 90 SynchronousCompositorOutputSurfaceDelegate* GetDelegate(); |
| 91 void UpdateFrameMetaData(const cc::CompositorFrameMetadata& frame_info); | 91 void UpdateFrameMetaData(const cc::CompositorFrameMetadata& frame_info); |
| 92 | 92 |
| 93 int routing_id_; | 93 int routing_id_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 106 cc::OutputSurfaceClient* output_surface_client_; | 106 cc::OutputSurfaceClient* output_surface_client_; |
| 107 | 107 |
| 108 base::WeakPtrFactory<SynchronousCompositorOutputSurface> weak_ptr_factory_; | 108 base::WeakPtrFactory<SynchronousCompositorOutputSurface> weak_ptr_factory_; |
| 109 | 109 |
| 110 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorOutputSurface); | 110 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorOutputSurface); |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 } // namespace content | 113 } // namespace content |
| 114 | 114 |
| 115 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURF
ACE_H_ | 115 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_OUTPUT_SURF
ACE_H_ |
| OLD | NEW |