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

Side by Side Diff: cc/resources/graphic_buffer.h

Issue 13135004: android_webview: changes to support Android GraphicBuffers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add GetStride() API on the GraphicBuffer Created 7 years, 8 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 2013 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 CC_RESOURCES_GRAPHIC_BUFFER_H_
6 #define CC_RESOURCES_GRAPHIC_BUFFER_H_
7
8 #include "base/basictypes.h"
9 #include "base/callback.h"
10 #include "base/memory/scoped_ptr.h"
11
12 namespace gfx {
13 class Size;
14 }
15
16 namespace cc {
17
18 // Interface for creating and accessing a zero-copy buffer such as GraphicBuffer
19 // of Android framework.
20 class GraphicBuffer {
joth 2013/04/02 19:12:11 can we make and statements about the thread safety
kaanb 2013/04/02 23:16:54 Done.
21 public:
22 // This factory is called in ResourceProvider::CreateGraphicBuffer() to
joth 2013/04/02 19:12:11 this comment is incorrect w.r.t this patch in isol
kaanb 2013/04/02 23:16:54 Done.
23 // create new instances.
24 typedef base::Callback<scoped_ptr<cc::GraphicBuffer>(const gfx::Size&)>
25 Factory;
26 virtual ~GraphicBuffer() {}
27
28 // Locks the buffer for the usage specified so the client
29 // can read or write the bitmap data in |*vaddr| subsequently.
30 // Returns 0 on success, non-zero on failure.
31 virtual bool LockForRead(void** vaddr) = 0;
32 virtual bool LockForWrite(void** vaddr) = 0;
33 // Unlocks the buffer. Returns 0 on success, non-zero otherwise.
joth 2013/04/02 19:12:11 Also document:- 1/ can LockForRead be followed by
kaanb 2013/04/02 23:16:54 Actually the Lock() is somewhat of a misnomer. Loo
34 virtual bool Unlock() = 0;
35 // Returns the size of the buffer
36 virtual gfx::Size GetSize() = 0;
37 // Returns the native pointer for the graphic buffer.
38 virtual void* GetNativeBuffer() = 0;
39 // Returns the stride for the graphic buffer.
40 virtual uint32 GetStride() = 0;
41 };
42
43 } // namespace cc
44
45 #endif // CC_RESOURCES_GRAPHIC_BUFFER_H_
OLDNEW
« android_webview/renderer/aw_content_renderer_client.cc ('K') | « cc/cc.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698