diff options
author | tschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-03 23:53:29 +0000 |
---|---|---|
committer | tschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-03 23:53:29 +0000 |
commit | b49b27f504501ecafee601985176dcbad9540f56 (patch) | |
tree | ae6fabf2751a23dffb977c7c6ad7016b21f672ce /o3d/plugin/mac/plugin_mac.mm | |
parent | d2135bbf2b6f78584499302506e94f2a7d4c0364 (diff) | |
download | chromium_src-b49b27f504501ecafee601985176dcbad9540f56.zip chromium_src-b49b27f504501ecafee601985176dcbad9540f56.tar.gz chromium_src-b49b27f504501ecafee601985176dcbad9540f56.tar.bz2 |
Port O2D to Mac, currently just for Core Graphics (the drawing model used in Chrome on 10.5). Unfortunately the performance is not yet good enough to prefer it over the CGL + GPU readback + CoreGraphics re-render code path currently in use, so some optimization work will be necessary.
TEST=loaded O3D on OSX with RenderMode=Auto and RenderMode=2D in Chrome 9 on 10.5 and 10.6, Safari 4 on 10.5, Safari 5 on 10.6, and FF 3.6 on 10.5 and 10.6 and verified that Auto works everywhere, 2D works in Chrome on 10.5, and 2D fails without crashing in the remaining cases; unit tests
BUG=none
Review URL: http://codereview.chromium.org/6614005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76839 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/plugin/mac/plugin_mac.mm')
-rw-r--r-- | o3d/plugin/mac/plugin_mac.mm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/o3d/plugin/mac/plugin_mac.mm b/o3d/plugin/mac/plugin_mac.mm index 9fb57a5..199a061 100644 --- a/o3d/plugin/mac/plugin_mac.mm +++ b/o3d/plugin/mac/plugin_mac.mm @@ -270,22 +270,22 @@ void RenderTimer::TimerCallback(CFRunLoopTimerRef timer, void* info) { obj->GetFullscreenMacWindow()->IdleCallback(); } - // We're visible if (a) we are in fullscreen mode, (b) our cliprect - // height and width are both a sensible size, ie > 1 pixel, or (c) if - // we are rendering to render surfaces (CoreGraphics drawing model, - // essentially offscreen rendering). + // We're visible if (a) we are in fullscreen mode, (b) we are using + // QuickDraw and our cliprect height and width are both a sensible size, ie + // > 1 pixel, or (c) we are using Core Graphics. // // We don't check for 0 as we have to size to 1 x 1 on occasion rather than // 0 x 0 to avoid crashing the Apple software renderer, but do not want to // actually draw to a 1 x 1 pixel area. bool plugin_visible = in_fullscreen || - (obj->last_buffer_rect_[2] > 1 && obj->last_buffer_rect_[3] > 1) || - obj->IsOffscreenRenderingEnabled(); + (obj->drawing_model_ == NPDrawingModelQuickDraw && + obj->last_buffer_rect_[2] > 1 && obj->last_buffer_rect_[3] > 1) || + obj->drawing_model_ == NPDrawingModelCoreGraphics; if (plugin_visible && obj->renderer()) { if (obj->client()->NeedsRender()) { // Force a sync to the VBL (once per timer callback) - // to avoid tearing + // to avoid tearing, if using GL. GLint sync = (i == 0); if (obj->mac_cgl_context_) { CGLSetParameter(obj->mac_cgl_context_, kCGLCPSwapInterval, &sync); @@ -293,7 +293,7 @@ void RenderTimer::TimerCallback(CFRunLoopTimerRef timer, void* info) { aglSetInteger(obj->mac_agl_context_, AGL_SWAP_INTERVAL, &sync); } - if (obj->IsOffscreenRenderingEnabled()) { + if (obj->drawing_model_ == NPDrawingModelCoreGraphics) { NPRect rect = { 0 }; rect.bottom = obj->height(); rect.right = obj->width(); |