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_SW_H_ | 5 #ifndef ANDROID_WEBVIEW_PUBLIC_BROWSER_DRAW_SW_H_ |
6 #define ANDROID_WEBVIEW_PUBLIC_BROWSER_DRAW_SW_H_ | 6 #define ANDROID_WEBVIEW_PUBLIC_BROWSER_DRAW_SW_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 int version; // The kAwPixelInfoVersion this struct was built with. | 28 int version; // The kAwPixelInfoVersion this struct was built with. |
29 int config; // |pixel| format: a value from AwPixelConfig. | 29 int config; // |pixel| format: a value from AwPixelConfig. |
30 int width; // In pixels. | 30 int width; // In pixels. |
31 int height; // In pixels. | 31 int height; // In pixels. |
32 int row_bytes; // Number of bytes from start of one line to next. | 32 int row_bytes; // Number of bytes from start of one line to next. |
33 void* pixels; // The pixels, all (height * row_bytes) of them. | 33 void* pixels; // The pixels, all (height * row_bytes) of them. |
34 // The Matrix and Clip are relative to |pixels|, not the source canvas. | 34 // The Matrix and Clip are relative to |pixels|, not the source canvas. |
35 float matrix[9]; // The matrix currently in effect on the canvas. | 35 float matrix[9]; // The matrix currently in effect on the canvas. |
36 int clip_rect_count; // Number of rects in |clip_rects|. | 36 int clip_rect_count; // Number of rects in |clip_rects|. |
37 int* clip_rects; // Clip area: 4 ints per rect in {x,y,w,h} format. | 37 int* clip_rects; // Clip area: 4 ints per rect in {x,y,w,h} format. |
38 void* clip_region; // TODO(joth): remove clip_region and clip_region_size. | |
39 size_t clip_region_size; | |
40 // NOTE: If you add more members, bump kAwPixelInfoVersion. | 38 // NOTE: If you add more members, bump kAwPixelInfoVersion. |
41 }; | 39 }; |
42 | 40 |
43 // Function that can be called to fish out the underlying native pixel data | 41 // Function that can be called to fish out the underlying native pixel data |
44 // from a Java canvas object, for optimized rendering path. | 42 // from a Java canvas object, for optimized rendering path. |
45 // Returns the pixel info on success, which must be freed via a call to | 43 // Returns the pixel info on success, which must be freed via a call to |
46 // AwReleasePixelsFunction, or NULL. | 44 // AwReleasePixelsFunction, or NULL. |
47 typedef AwPixelInfo* (AwAccessPixelsFunction)(JNIEnv* env, jobject canvas); | 45 typedef AwPixelInfo* (AwAccessPixelsFunction)(JNIEnv* env, jobject canvas); |
48 | 46 |
49 // Must be called to balance every *successful* call to AwAccessPixelsFunction | 47 // Must be called to balance every *successful* call to AwAccessPixelsFunction |
(...skipping 12 matching lines...) Expand all Loading... |
62 // "vtable" for the functions declared in this file. An instance must be set via | 60 // "vtable" for the functions declared in this file. An instance must be set via |
63 // AwContents.setAwDrawSWFunctionTable | 61 // AwContents.setAwDrawSWFunctionTable |
64 struct AwDrawSWFunctionTable { | 62 struct AwDrawSWFunctionTable { |
65 AwAccessPixelsFunction* access_pixels; | 63 AwAccessPixelsFunction* access_pixels; |
66 AwReleasePixelsFunction* release_pixels; | 64 AwReleasePixelsFunction* release_pixels; |
67 AwCreatePictureFunction* create_picture; | 65 AwCreatePictureFunction* create_picture; |
68 AwIsSkiaVersionCompatibleFunction* is_skia_version_compatible; | 66 AwIsSkiaVersionCompatibleFunction* is_skia_version_compatible; |
69 }; | 67 }; |
70 | 68 |
71 #endif // ANDROID_WEBVIEW_PUBLIC_BROWSER_DRAW_SW_H_ | 69 #endif // ANDROID_WEBVIEW_PUBLIC_BROWSER_DRAW_SW_H_ |
OLD | NEW |