Skip to content

Commit 7b6a758

Browse files
committed
Pass width/height parameters to webview
When webview draws into an fbo layer, it needs to know the size of that surface to create the rendering transform appropriately. This change copies in the current viewport size to the structure that is passed to the webview. Change-Id: I7160b0836d00834134c799c95a439cdc045e2035
1 parent d1f3de4 commit 7b6a758

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

include/private/hwui/DrawGlInfo.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ struct DrawGlInfo {
3131
int clipRight;
3232
int clipBottom;
3333

34+
// Input: current width/height of destination surface
35+
int width;
36+
int height;
37+
3438
// Input: is the render target an FBO
3539
bool isLayer;
3640

libs/hwui/OpenGLRenderer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ status_t OpenGLRenderer::invokeFunctors(Rect& dirty) {
249249
info.clipRight = 0;
250250
info.clipBottom = 0;
251251
info.isLayer = false;
252+
info.width = 0;
253+
info.height = 0;
252254
memset(info.transform, 0, sizeof(float) * 16);
253255

254256
size_t count = functors.size();
@@ -292,6 +294,8 @@ status_t OpenGLRenderer::callDrawGLFunction(Functor* functor, Rect& dirty) {
292294
info.clipRight = clip.right;
293295
info.clipBottom = clip.bottom;
294296
info.isLayer = hasLayer();
297+
info.width = getSnapshot()->viewport.getWidth();
298+
info.height = getSnapshot()->height;
295299
getSnapshot()->transform->copyTo(&info.transform[0]);
296300

297301
status_t result = (*functor)(DrawGlInfo::kModeDraw, &info);

0 commit comments

Comments
 (0)