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 ANDROID_WEBVIEW_PUBLIC_BROWSER_DRAW_GL_H_ | 5 #ifndef ANDROID_WEBVIEW_PUBLIC_BROWSER_DRAW_GL_H_ |
6 #define ANDROID_WEBVIEW_PUBLIC_BROWSER_DRAW_GL_H_ | 6 #define ANDROID_WEBVIEW_PUBLIC_BROWSER_DRAW_GL_H_ |
7 | 7 |
8 #ifdef __cplusplus | 8 #ifdef __cplusplus |
9 extern "C" { | 9 extern "C" { |
10 #endif | 10 #endif |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // Function to invoke a direct GL draw into the client's pre-configured | 71 // Function to invoke a direct GL draw into the client's pre-configured |
72 // GL context. Obtained via AwContents.getDrawGLFunction() (static). | 72 // GL context. Obtained via AwContents.getDrawGLFunction() (static). |
73 // |view_context| is an opaque identifier that was returned by the corresponding | 73 // |view_context| is an opaque identifier that was returned by the corresponding |
74 // call to AwContents.getAwDrawGLViewContext(). | 74 // call to AwContents.getAwDrawGLViewContext(). |
75 // |draw_info| carries the in and out parameters for this draw. | 75 // |draw_info| carries the in and out parameters for this draw. |
76 // |spare| ignored; pass NULL. | 76 // |spare| ignored; pass NULL. |
77 typedef void (AwDrawGLFunction)(int view_context, | 77 typedef void (AwDrawGLFunction)(int view_context, |
78 AwDrawGLInfo* draw_info, | 78 AwDrawGLInfo* draw_info, |
79 void* spare); | 79 void* spare); |
80 | 80 |
| 81 // Called to create a GraphicBuffer |
| 82 typedef int AwCreateGraphicBufferFunction(int w, int h); |
| 83 // Called to release a GraphicBuffer |
| 84 typedef void AwReleaseGraphicBufferFunction(int buffer_id); |
| 85 // Called to lock a GraphicBuffer for reading |
| 86 typedef int AwLockForReadFunction(int buffer_id, void** vaddr); |
| 87 // Called to lock a GraphicBuffer for writing |
| 88 typedef int AwLockForWriteFunction(int buffer_id, void** vaddr); |
| 89 // Called to unlock a GraphicBuffer |
| 90 typedef int AwUnlockFunction(int buffer_id); |
| 91 // Called to get a native buffer pointer |
| 92 typedef void* AwGetNativeBufferFunction(int buffer_id); |
| 93 // Called to get the stride of the buffer |
| 94 typedef unsigned int AwGetStrideFunction(int buffer_id); |
| 95 |
| 96 // Set of functions used in rendering in hardware mode |
| 97 struct AwDrawGLFunctionTable { |
| 98 AwCreateGraphicBufferFunction* create_graphic_buffer; |
| 99 AwReleaseGraphicBufferFunction* release_graphic_buffer; |
| 100 AwLockForReadFunction* lock_for_read; |
| 101 AwLockForWriteFunction* lock_for_write; |
| 102 AwUnlockFunction* unlock; |
| 103 AwGetNativeBufferFunction* get_native_buffer; |
| 104 AwGetStrideFunction* get_stride; |
| 105 }; |
| 106 |
81 #ifdef __cplusplus | 107 #ifdef __cplusplus |
82 } // extern "C" | 108 } // extern "C" |
83 #endif | 109 #endif |
84 | 110 |
85 #endif // ANDROID_WEBVIEW_PUBLIC_BROWSER_DRAW_GL_H_ | 111 #endif // ANDROID_WEBVIEW_PUBLIC_BROWSER_DRAW_GL_H_ |
OLD | NEW |