1 // Copyright (c) 2014 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.
7 #include "android_webview/public/browser/draw_gl.h"
11 JNIEXPORT jint
JNI_OnLoad(JavaVM
* vm
, void* reserved
) {
12 return JNI_VERSION_1_4
;
15 // This code goes into its own dynamic library, so we cannot depend on
16 // any other components like base.
17 JNIEXPORT
void JNICALL
18 Java_org_chromium_android_1webview_shell_DrawGL_nativeDrawGL(
28 AwDrawGLInfo draw_info
;
29 draw_info
.mode
= static_cast<AwDrawGLInfo::Mode
>(mode
);
30 draw_info
.version
= kAwDrawGLInfoVersion
;
31 draw_info
.is_layer
= false;
32 draw_info
.width
= width
;
33 draw_info
.height
= height
;
34 draw_info
.clip_left
= 0;
35 draw_info
.clip_top
= 0;
36 draw_info
.clip_bottom
= height
;
37 draw_info
.clip_right
= width
;
38 draw_info
.transform
[0] = 1.0;
39 draw_info
.transform
[1] = 0.0;
40 draw_info
.transform
[2] = 0.0;
41 draw_info
.transform
[3] = 0.0;
43 draw_info
.transform
[4] = 0.0;
44 draw_info
.transform
[5] = 1.0;
45 draw_info
.transform
[6] = 0.0;
46 draw_info
.transform
[7] = 0.0;
48 draw_info
.transform
[8] = 0.0;
49 draw_info
.transform
[9] = 0.0;
50 draw_info
.transform
[10] = 1.0;
51 draw_info
.transform
[11] = 0.0;
53 draw_info
.transform
[12] = -scroll_x
;
54 draw_info
.transform
[13] = -scroll_y
;
55 draw_info
.transform
[14] = 0.0;
56 draw_info
.transform
[15] = 1.0;
57 AwDrawGLFunction
* draw_func
= reinterpret_cast<AwDrawGLFunction
*>(draw_gl
);
58 draw_func(view
, &draw_info
, 0);