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

Side by Side Diff: android_webview/public/browser/draw_sw.h

Issue 11823027: [Android WebView] Implement the capture picture API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removing any IPC DCHECKS. Created 7 years, 10 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
« no previous file with comments | « android_webview/native/aw_contents.cc ('k') | android_webview/renderer/aw_render_view_ext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
11 #ifndef __cplusplus 11 #ifndef __cplusplus
12 #error "Can't mix C and C++ when using jni.h" 12 #error "Can't mix C and C++ when using jni.h"
13 #endif 13 #endif
14 14
15 class SkPicture;
16
15 // Holds the information required to implement the SW draw to system canvas. 17 // Holds the information required to implement the SW draw to system canvas.
16 struct AwPixelInfo { 18 struct AwPixelInfo {
17 int config; // In SkBitmap::Config format. 19 int config; // In SkBitmap::Config format.
18 int width; // In pixels. 20 int width; // In pixels.
19 int height; // In pixels. 21 int height; // In pixels.
20 int row_bytes; // Number of bytes from start of one line to next. 22 int row_bytes; // Number of bytes from start of one line to next.
21 void* pixels; // The pixels, all (height * row_bytes) of them. 23 void* pixels; // The pixels, all (height * row_bytes) of them.
22 float matrix[9]; // The matrix currently in effect on the canvas. 24 float matrix[9]; // The matrix currently in effect on the canvas.
23 void* clip_region; // Flattened clip region. 25 void* clip_region; // Flattened clip region.
24 size_t clip_region_size; // Number of bytes in |clip_region|. 26 size_t clip_region_size; // Number of bytes in |clip_region|.
25 }; 27 };
26 28
27 // Function that can be called to fish out the underlying native pixel data 29 // Function that can be called to fish out the underlying native pixel data
28 // from a Java canvas object, for optimized rendering path. 30 // from a Java canvas object, for optimized rendering path.
29 // Returns the pixel info on success, which must be freed via a call to 31 // Returns the pixel info on success, which must be freed via a call to
30 // AwReleasePixelsFunction, or NULL. 32 // AwReleasePixelsFunction, or NULL.
31 typedef AwPixelInfo* (AwAccessPixelsFunction)(JNIEnv* env, jobject canvas); 33 typedef AwPixelInfo* (AwAccessPixelsFunction)(JNIEnv* env, jobject canvas);
32 34
33 // Must be called to balance every *successful* call to AwAccessPixelsFunction 35 // Must be called to balance every *successful* call to AwAccessPixelsFunction
34 // (i.e. that returned true). 36 // (i.e. that returned true).
35 typedef void (AwReleasePixelsFunction)(AwPixelInfo* pixels); 37 typedef void (AwReleasePixelsFunction)(AwPixelInfo* pixels);
36 38
39 // Called to create an Android Picture object encapsulating a native SkPicture.
40 typedef jobject (AwCreatePictureFunction)(JNIEnv* env, SkPicture* picture);
41
42 // Method that returns the current Skia function.
43 typedef void (SkiaVersionFunction)(int* major, int* minor, int* patch);
44
45 // Called to verify if the Skia versions are compatible.
46 typedef bool (AwIsSkiaVersionCompatibleFunction)(SkiaVersionFunction function);
47
37 // "vtable" for the functions declared in this file. An instance must be set via 48 // "vtable" for the functions declared in this file. An instance must be set via
38 // AwContents.setAwDrawSWFunctionTable 49 // AwContents.setAwDrawSWFunctionTable
39 struct AwDrawSWFunctionTable { 50 struct AwDrawSWFunctionTable {
40 AwAccessPixelsFunction* access_pixels; 51 AwAccessPixelsFunction* access_pixels;
41 AwReleasePixelsFunction* release_pixels; 52 AwReleasePixelsFunction* release_pixels;
53 AwCreatePictureFunction* create_picture;
54 AwIsSkiaVersionCompatibleFunction* is_skia_version_compatible;
42 }; 55 };
43 56
44 #endif // ANDROID_WEBVIEW_PUBLIC_BROWSER_DRAW_SW_H_ 57 #endif // ANDROID_WEBVIEW_PUBLIC_BROWSER_DRAW_SW_H_
OLDNEW
« no previous file with comments | « android_webview/native/aw_contents.cc ('k') | android_webview/renderer/aw_render_view_ext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698