diff options
author | Bo Liu <boliu@google.com> | 2014-04-27 20:35:13 -0700 |
---|---|---|
committer | Bo Liu <boliu@google.com> | 2014-04-29 14:25:16 -0700 |
commit | 5c5385f3e5f86c5183408e52f76f1bb7798cda9a (patch) | |
tree | b8aba224fd6d7856e0b862c27d6a4e66f0fda08e /chromium/plat_support | |
parent | a4ff082306972f691e0b53ae30f1fa3203bd5189 (diff) | |
download | webview-5c5385f3e5f86c5183408e52f76f1bb7798cda9a.tar.gz |
Use invokeFunctor instead of attachFunctor
BUG: 13961296
Change-Id: I3fb6fde088ade1c239995131be326400366152a3
Diffstat (limited to 'chromium/plat_support')
-rw-r--r-- | chromium/plat_support/draw_gl_functor.cpp | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/chromium/plat_support/draw_gl_functor.cpp b/chromium/plat_support/draw_gl_functor.cpp index ab8878c..2063988 100644 --- a/chromium/plat_support/draw_gl_functor.cpp +++ b/chromium/plat_support/draw_gl_functor.cpp @@ -52,22 +52,36 @@ class DrawGLFunctor : public Functor { } AwDrawGLInfo aw_info; - aw_info.mode = (what == DrawGlInfo::kModeProcess) ? - AwDrawGLInfo::kModeProcess : AwDrawGLInfo::kModeDraw; - DrawGlInfo* gl_info = reinterpret_cast<DrawGlInfo*>(data); - - // Map across the input values. - aw_info.clip_left = gl_info->clipLeft; - aw_info.clip_top = gl_info->clipTop; - aw_info.clip_right = gl_info->clipRight; - aw_info.clip_bottom = gl_info->clipBottom; - aw_info.width = gl_info->width; - aw_info.height = gl_info->height; - aw_info.is_layer = gl_info->isLayer; - COMPILE_ASSERT(NELEM(aw_info.transform) == NELEM(gl_info->transform), - mismatched_transform_matrix_sizes); - for (int i = 0; i < NELEM(aw_info.transform); ++i) { - aw_info.transform[i] = gl_info->transform[i]; + switch (what) { + case DrawGlInfo::kModeDraw: { + aw_info.mode = AwDrawGLInfo::kModeDraw; + DrawGlInfo* gl_info = reinterpret_cast<DrawGlInfo*>(data); + + // Map across the input values. + aw_info.clip_left = gl_info->clipLeft; + aw_info.clip_top = gl_info->clipTop; + aw_info.clip_right = gl_info->clipRight; + aw_info.clip_bottom = gl_info->clipBottom; + aw_info.width = gl_info->width; + aw_info.height = gl_info->height; + aw_info.is_layer = gl_info->isLayer; + COMPILE_ASSERT(NELEM(aw_info.transform) == NELEM(gl_info->transform), + mismatched_transform_matrix_sizes); + for (int i = 0; i < NELEM(aw_info.transform); ++i) { + aw_info.transform[i] = gl_info->transform[i]; + } + break; + } + case DrawGlInfo::kModeProcess: + aw_info.mode = AwDrawGLInfo::kModeProcess; + break; + case DrawGlInfo::kModeProcessNoContext: + // TODO: Fix once ProcessNoContext is in chromium. + aw_info.mode = AwDrawGLInfo::kModeProcess; + break; + default: + ALOGE("Unexpected DrawGLInfo type %d", what); + return DrawGlInfo::kStatusDone; } // Invoke the DrawGL method. |