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

Side by Side Diff: android_webview/test/shell/src/draw_gl/draw_gl.cc

Issue 524933002: Revert of android: Use hw acceleration in android_webview_shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 (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.
4
5 #include <jni.h>
6
7 #include "android_webview/public/browser/draw_gl.h"
8
9 extern "C" {
10
11 JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
12 return JNI_VERSION_1_4;
13 }
14
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(
19 JNIEnv*,
20 jclass,
21 jlong draw_gl,
22 jlong view,
23 jint width,
24 jint height,
25 jint scroll_x,
26 jint scroll_y,
27 jint mode) {
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;
42
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;
47
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;
52
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);
59 }
60
61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698