Skip to content

Commit f57eb43

Browse files
chethaaseAndroid (Google) Code Review
authored andcommitted
Merge "Pass width/height parameters to webview"
2 parents cae80b2 + 7b6a758 commit f57eb43

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)