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

Side by Side Diff: content/public/browser/android/compositor.h

Issue 11090075: Expose the WebGraphicsContext3D for Android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Expose destroy/create texture methods instead of the context Created 8 years, 2 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
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_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_
6 #define CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "ui/gfx/native_widget_types.h" 9 #include "ui/gfx/native_widget_types.h"
10 #include "ui/gfx/rect.h" 10 #include "ui/gfx/rect.h"
11 #include "ui/gfx/size.h" 11 #include "ui/gfx/size.h"
12 12
13 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h"
14
15 namespace gfx {
16 class JavaBitmap;
17 }
18
13 namespace WebKit { 19 namespace WebKit {
14 class WebLayer; 20 class WebLayer;
15 } 21 }
16 22
17 namespace content { 23 namespace content {
18 24
19 // An interface to the browser-side compositor. 25 // An interface to the browser-side compositor.
20 class Compositor { 26 class Compositor {
21 public: 27 public:
22 virtual ~Compositor() {} 28 virtual ~Compositor() {}
(...skipping 18 matching lines...) Expand all
41 // The buffer must be at least window width * height * 4 (RGBA) bytes large. 47 // The buffer must be at least window width * height * 4 (RGBA) bytes large.
42 // The buffer is not modified if false is returned. 48 // The buffer is not modified if false is returned.
43 virtual bool CompositeAndReadback(void *pixels, const gfx::Rect& rect) = 0; 49 virtual bool CompositeAndReadback(void *pixels, const gfx::Rect& rect) = 0;
44 50
45 // Callback to be run after the frame has been drawn. It passes back 51 // Callback to be run after the frame has been drawn. It passes back
46 // a synchronization point identifier. 52 // a synchronization point identifier.
47 typedef base::Callback<void(uint32)> SurfacePresentedCallback; 53 typedef base::Callback<void(uint32)> SurfacePresentedCallback;
48 54
49 virtual void OnSurfaceUpdated(const SurfacePresentedCallback& callback) = 0; 55 virtual void OnSurfaceUpdated(const SurfacePresentedCallback& callback) = 0;
50 56
57 // Generates an OpenGL texture and returns a texture handle. May return 0
58 // if the current context is lost.
59 virtual WebKit::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) = 0;
60
61 // Generates an OpenGL compressed texture and returns a texture handle. May
62 // return 0 if the current context is lost.
63 virtual WebKit::WebGLId GenerateCompressedTexture(gfx::Size& size,
64 int data_size,
65 void* data) = 0;
66
67 // Deletes an OpenGL texture. Returns true if the texture could be deleted,
68 // or false if the texture could not be deleted due to a lost context.
no sievers 2012/10/12 22:45:56 I think it maybe be hard to guarantee without a sy
David Trainor- moved to gerrit 2012/10/15 19:01:56 Done.
69 virtual bool DeleteTexture(WebKit::WebGLId texture_id) = 0;
70
51 protected: 71 protected:
52 Compositor() {} 72 Compositor() {}
53 }; 73 };
54 74
55 } // namespace content 75 } // namespace content
56 76
57 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ 77 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698