| OLD | NEW | 
|    1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |    1 // Copyright (c) 2012 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_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |    5 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 
|    6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |    6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_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/containers/scoped_ptr_hash_map.h" |   10 #include "base/containers/scoped_ptr_hash_map.h" | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
|   32  |   32  | 
|   33 // ----------------------------------------------------------------------------- |   33 // ----------------------------------------------------------------------------- | 
|   34 // Browser-side compositor that manages a tree of content and UI layers. |   34 // Browser-side compositor that manages a tree of content and UI layers. | 
|   35 // ----------------------------------------------------------------------------- |   35 // ----------------------------------------------------------------------------- | 
|   36 class CONTENT_EXPORT CompositorImpl |   36 class CONTENT_EXPORT CompositorImpl | 
|   37     : public Compositor, |   37     : public Compositor, | 
|   38       public cc::LayerTreeHostClient, |   38       public cc::LayerTreeHostClient, | 
|   39       public cc::LayerTreeHostSingleThreadClient, |   39       public cc::LayerTreeHostSingleThreadClient, | 
|   40       public ImageTransportFactoryAndroidObserver { |   40       public ImageTransportFactoryAndroidObserver { | 
|   41  public: |   41  public: | 
|   42   explicit CompositorImpl(CompositorClient* client); |   42   CompositorImpl(CompositorClient* client, gfx::NativeWindow root_window); | 
|   43   virtual ~CompositorImpl(); |   43   virtual ~CompositorImpl(); | 
|   44  |   44  | 
|   45   static bool IsInitialized(); |   45   static bool IsInitialized(); | 
|   46  |   46  | 
|   47   // Returns the Java Surface object for a given view surface id. |   47   // Returns the Java Surface object for a given view surface id. | 
|   48   static jobject GetSurface(int surface_id); |   48   static jobject GetSurface(int surface_id); | 
|   49  |   49  | 
|   50   // Compositor implementation. |   50   // Compositor implementation. | 
|   51   virtual void SetRootLayer(scoped_refptr<cc::Layer> root) OVERRIDE; |   51   virtual void SetRootLayer(scoped_refptr<cc::Layer> root) OVERRIDE; | 
|   52   virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE; |   52   virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE; | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
|   74   virtual void WillBeginMainFrame(int frame_id) OVERRIDE {} |   74   virtual void WillBeginMainFrame(int frame_id) OVERRIDE {} | 
|   75   virtual void DidBeginMainFrame() OVERRIDE {} |   75   virtual void DidBeginMainFrame() OVERRIDE {} | 
|   76   virtual void Animate(double frame_begin_time) OVERRIDE {} |   76   virtual void Animate(double frame_begin_time) OVERRIDE {} | 
|   77   virtual void Layout() OVERRIDE {} |   77   virtual void Layout() OVERRIDE {} | 
|   78   virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, |   78   virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, | 
|   79                                    float page_scale) OVERRIDE {} |   79                                    float page_scale) OVERRIDE {} | 
|   80   virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) |   80   virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) | 
|   81       OVERRIDE; |   81       OVERRIDE; | 
|   82   virtual void DidInitializeOutputSurface(bool success) OVERRIDE {} |   82   virtual void DidInitializeOutputSurface(bool success) OVERRIDE {} | 
|   83   virtual void WillCommit() OVERRIDE {} |   83   virtual void WillCommit() OVERRIDE {} | 
|   84   virtual void DidCommit() OVERRIDE {} |   84   virtual void DidCommit() OVERRIDE; | 
|   85   virtual void DidCommitAndDrawFrame() OVERRIDE {} |   85   virtual void DidCommitAndDrawFrame() OVERRIDE {} | 
|   86   virtual void DidCompleteSwapBuffers() OVERRIDE; |   86   virtual void DidCompleteSwapBuffers() OVERRIDE; | 
|   87   virtual scoped_refptr<cc::ContextProvider> |   87   virtual scoped_refptr<cc::ContextProvider> | 
|   88       OffscreenContextProvider() OVERRIDE; |   88       OffscreenContextProvider() OVERRIDE; | 
|   89  |   89  | 
|   90   // LayerTreeHostSingleThreadClient implementation. |   90   // LayerTreeHostSingleThreadClient implementation. | 
|   91   virtual void ScheduleComposite() OVERRIDE; |   91   virtual void ScheduleComposite() OVERRIDE; | 
|   92   virtual void DidPostSwapBuffers() OVERRIDE; |   92   virtual void DidPostSwapBuffers() OVERRIDE; | 
|   93   virtual void DidAbortSwapBuffers() OVERRIDE; |   93   virtual void DidAbortSwapBuffers() OVERRIDE; | 
|   94  |   94  | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
|  110   int surface_id_; |  110   int surface_id_; | 
|  111  |  111  | 
|  112   CompositorClient* client_; |  112   CompositorClient* client_; | 
|  113  |  113  | 
|  114   scoped_refptr<cc::ContextProvider> null_offscreen_context_provider_; |  114   scoped_refptr<cc::ContextProvider> null_offscreen_context_provider_; | 
|  115  |  115  | 
|  116   typedef base::ScopedPtrHashMap<cc::UIResourceId, cc::ScopedUIResource> |  116   typedef base::ScopedPtrHashMap<cc::UIResourceId, cc::ScopedUIResource> | 
|  117         UIResourceMap; |  117         UIResourceMap; | 
|  118   UIResourceMap ui_resource_map_; |  118   UIResourceMap ui_resource_map_; | 
|  119  |  119  | 
 |  120   gfx::NativeWindow root_window_; | 
 |  121  | 
|  120   DISALLOW_COPY_AND_ASSIGN(CompositorImpl); |  122   DISALLOW_COPY_AND_ASSIGN(CompositorImpl); | 
|  121 }; |  123 }; | 
|  122  |  124  | 
|  123 } // namespace content |  125 } // namespace content | 
|  124  |  126  | 
|  125 #endif  // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |  127 #endif  // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 
| OLD | NEW |