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

Side by Side Diff: content/browser/renderer_host/compositor_impl_android.h

Issue 10828356: Very basic Android browser-side compositing support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ifdef Attach/RemoveLayer API Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "content/public/browser/android/compositor.h"
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h"
13 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h"
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli ent.h"
15
16 struct ANativeWindow;
17
18 namespace content {
19 class GraphicsContext;
20
21 // -----------------------------------------------------------------------------
22 // Browser-side compositor that manages a tree of content and UI layers.
23 // -----------------------------------------------------------------------------
24 class CompositorImpl : public Compositor,
25 public WebKit::WebLayerTreeViewClient {
26 public:
27 CompositorImpl();
28 virtual ~CompositorImpl();
29
30 // Compositor implementation.
31 virtual void SetRootLayer(WebKit::WebLayer* root) OVERRIDE;
32 virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE;
33 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE;
34 virtual void OnSurfaceUpdated(
35 const SurfacePresentedCallback& callback) OVERRIDE;
36
37 // WebLayerTreeViewClient implementation.
38 virtual void updateAnimations(double frameBeginTime) OVERRIDE;
39 virtual void layout() OVERRIDE;
40 virtual void applyScrollAndScale(const WebKit::WebSize& scrollDelta,
41 float scaleFactor) OVERRIDE;
42 virtual WebKit::WebCompositorOutputSurface* createOutputSurface() OVERRIDE;
43 virtual void didRecreateOutputSurface(bool success) OVERRIDE;
44 virtual void didCommit() OVERRIDE;
45 virtual void didCommitAndDrawFrame() OVERRIDE;
46 virtual void didCompleteSwapBuffers() OVERRIDE;
47 virtual void scheduleComposite() OVERRIDE;
48
49 private:
50 scoped_ptr<WebKit::WebLayer> root_layer_;
51 scoped_ptr<WebKit::WebLayerTreeView> host_;
52
53 scoped_ptr<GraphicsContext> context_;
54
55 gfx::Size size_;
56
57 DISALLOW_COPY_AND_ASSIGN(CompositorImpl);
58 };
59
60 } // namespace content
61
62 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698