Skip to content

Commit

Permalink
[Android] Introduce the information required in WebView to trigger GL…
Browse files Browse the repository at this point in the history
… drawing operations.

BUG=none


Review URL: https://chromiumcodereview.appspot.com/11368032

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165674 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
leandrogracia@chromium.org committed Nov 2, 2012
1 parent 61847e3 commit 3359ab1
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions android_webview/android_webview.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
'lib/main/aw_main_delegate.cc',
'lib/main/aw_main_delegate.h',
'lib/main/webview_entry_point.cc',
'public/browser/gl_draw.h',
'renderer/aw_content_renderer_client.cc',
'renderer/aw_content_renderer_client.h',
'renderer/aw_render_process_observer.cc',
Expand Down
52 changes: 52 additions & 0 deletions android_webview/public/browser/gl_draw.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ANDROID_WEBVIEW_PUBLIC_BROWSER_GL_DRAW_H_
#define ANDROID_WEBVIEW_PUBLIC_BROWSER_GL_DRAW_H_

#ifdef __cplusplus
extern "C" {
#endif

// Holds the information required to trigger an OpenGL drawing operation.
struct AwGLDrawInfo {

// Input: current clip rect.
int clip_left;
int clip_top;
int clip_right;
int clip_bottom;

// Input: current width/height of destination surface.
int width;
int height;

// Input: is the render target an FBO.
bool is_layer;

// Input: current transform matrix, in OpenGL format.
float transform[16];

// Output: dirty region to redraw.
float dirty_left;
float dirty_top;
float dirty_right;
float dirty_bottom;
};

// Function to invoke a direct GL draw into the client's pre-configured
// GL context. Obtained via AwContents.getGLDrawFunction() (static).
// |view_context| is an opaque pointer that was returned by the corresponding
// call to AwContents.onPrepareGlDraw().
// |draw_info| carries the in and out parameters for this draw.
// |spare| ignored; pass NULL.
typedef void (*AwGLDrawFunction)(void* view_context,
const GLDrawInfo* draw_info,
void* spare);

#ifdef __cplusplus
} // extern "C"
#endif

#endif // ANDROID_WEBVIEW_PUBLIC_BROWSER_GL_DRAW_H_

0 comments on commit 3359ab1

Please sign in to comment.