| 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/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "content/public/browser/android/compositor.h" | 11 #include "content/public/browser/android/compositor.h" |
| 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" | 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" |
| 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" |
| 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli
ent.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli
ent.h" |
| 15 | 15 |
| 16 | |
| 17 struct ANativeWindow; | 16 struct ANativeWindow; |
| 18 | 17 |
| 19 namespace content { | 18 namespace content { |
| 20 class GraphicsContext; | 19 class GraphicsContext; |
| 21 | 20 |
| 22 // ----------------------------------------------------------------------------- | 21 // ----------------------------------------------------------------------------- |
| 23 // Browser-side compositor that manages a tree of content and UI layers. | 22 // Browser-side compositor that manages a tree of content and UI layers. |
| 24 // ----------------------------------------------------------------------------- | 23 // ----------------------------------------------------------------------------- |
| 25 class CompositorImpl : public Compositor, | 24 class CompositorImpl : public Compositor, |
| 26 public WebKit::WebLayerTreeViewClient { | 25 public WebKit::WebLayerTreeViewClient { |
| 27 public: | 26 public: |
| 28 explicit CompositorImpl(Compositor::Client* client); | 27 explicit CompositorImpl(Compositor::Client* client); |
| 29 virtual ~CompositorImpl(); | 28 virtual ~CompositorImpl(); |
| 30 | 29 |
| 31 static bool IsInitialized(); | 30 static bool IsInitialized(); |
| 32 | 31 |
| 33 // Compositor implementation. | 32 // Compositor implementation. |
| 34 virtual void SetRootLayer(WebKit::WebLayer* root) OVERRIDE; | 33 virtual void SetRootLayer(WebKit::WebLayer* root) OVERRIDE; |
| 35 virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE; | 34 virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE; |
| 36 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE; | 35 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE; |
| 37 virtual bool CompositeAndReadback( | 36 virtual bool CompositeAndReadback( |
| 38 void *pixels, const gfx::Rect& rect) OVERRIDE; | 37 void *pixels, const gfx::Rect& rect) OVERRIDE; |
| 39 virtual void Composite() OVERRIDE; | 38 virtual void Composite() OVERRIDE; |
| 40 virtual WebKit::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) OVERRIDE; | 39 virtual WebKit::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) OVERRIDE; |
| 41 virtual WebKit::WebGLId GenerateCompressedTexture( | 40 virtual WebKit::WebGLId GenerateCompressedTexture( |
| 42 gfx::Size& size, int data_size, void* data) OVERRIDE; | 41 gfx::Size& size, int data_size, void* data) OVERRIDE; |
| 43 virtual void DeleteTexture(WebKit::WebGLId texture_id) OVERRIDE; | 42 virtual void DeleteTexture(WebKit::WebGLId texture_id) OVERRIDE; |
| 43 virtual void CopyTextureToBitmap(WebKit::WebGLId texture_id, |
| 44 gfx::JavaBitmap& bitmap) OVERRIDE; |
| 44 | 45 |
| 45 // WebLayerTreeViewClient implementation. | 46 // WebLayerTreeViewClient implementation. |
| 46 virtual void updateAnimations(double frameBeginTime) OVERRIDE; | 47 virtual void updateAnimations(double frameBeginTime) OVERRIDE; |
| 47 virtual void layout() OVERRIDE; | 48 virtual void layout() OVERRIDE; |
| 48 virtual void applyScrollAndScale(const WebKit::WebSize& scrollDelta, | 49 virtual void applyScrollAndScale(const WebKit::WebSize& scrollDelta, |
| 49 float scaleFactor) OVERRIDE; | 50 float scaleFactor) OVERRIDE; |
| 50 virtual WebKit::WebCompositorOutputSurface* createOutputSurface() OVERRIDE; | 51 virtual WebKit::WebCompositorOutputSurface* createOutputSurface() OVERRIDE; |
| 51 virtual void didRecreateOutputSurface(bool success) OVERRIDE; | 52 virtual void didRecreateOutputSurface(bool success) OVERRIDE; |
| 52 virtual void didCommit() OVERRIDE; | 53 virtual void didCommit() OVERRIDE; |
| 53 virtual void didCommitAndDrawFrame() OVERRIDE; | 54 virtual void didCommitAndDrawFrame() OVERRIDE; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 68 int surface_id_; | 69 int surface_id_; |
| 69 | 70 |
| 70 Compositor::Client* client_; | 71 Compositor::Client* client_; |
| 71 | 72 |
| 72 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); | 73 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 } // namespace content | 76 } // namespace content |
| 76 | 77 |
| 77 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 78 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
| OLD | NEW |