diff options
author | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-18 00:24:39 +0000 |
---|---|---|
committer | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-18 00:24:39 +0000 |
commit | ad7a735e4d8752760050a483d9ddd7ce2014a768 (patch) | |
tree | 03608ecc38dd48f3a8eef5f8fb21ced2ae9ac3b1 /o3d | |
parent | ef3cd23c355aad534ffa99d2c8871776c0f548d4 (diff) | |
download | chromium_src-ad7a735e4d8752760050a483d9ddd7ce2014a768.zip chromium_src-ad7a735e4d8752760050a483d9ddd7ce2014a768.tar.gz chromium_src-ad7a735e4d8752760050a483d9ddd7ce2014a768.tar.bz2 |
I think this fixes the issue with init-status-test.html
It worked for me :-)
Review URL: http://codereview.chromium.org/126255
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18674 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r-- | o3d/plugin/mac/main_mac.mm | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/o3d/plugin/mac/main_mac.mm b/o3d/plugin/mac/main_mac.mm index 17f1039..c9dcec0 100644 --- a/o3d/plugin/mac/main_mac.mm +++ b/o3d/plugin/mac/main_mac.mm @@ -903,7 +903,7 @@ extern "C" { if (obj->drawing_model_ == NPDrawingModelOpenGL) { CGLSetCurrentContext(obj->mac_cgl_context_); - } else if (obj->mac_agl_context_ == NULL) { // setup AGL context + } else if (!had_a_window && obj->mac_agl_context_ == NULL) { // setup AGL context AGLPixelFormat myAGLPixelFormat = NULL; // We need to spec out a few similar but different sets of renderer @@ -1075,8 +1075,10 @@ extern "C" { // Renderer is already initialized from a previous call to this function, // just update size and position and return. if (had_a_window) { - obj->renderer()->SetClientOriginOffset(gl_x_origin, gl_y_origin); - obj->Resize(window->width, window->height); + if (obj->renderer()) { + obj->renderer()->SetClientOriginOffset(gl_x_origin, gl_y_origin); + obj->Resize(window->width, window->height); + } return NPERR_NO_ERROR; } @@ -1094,22 +1096,22 @@ extern "C" { ::aglDestroyContext(obj->mac_agl_context_); obj->mac_agl_context_ = NULL; } - return NPERR_NO_ERROR; } obj->client()->Init(); obj->client()->SetRenderOnDemandCallback( new RenderOnDemandCallbackHandler(obj)); - obj->renderer()->SetClientOriginOffset(gl_x_origin, gl_y_origin); - obj->Resize(window->width, window->height); - + if (obj->renderer()) { + obj->renderer()->SetClientOriginOffset(gl_x_origin, gl_y_origin); + obj->Resize(window->width, window->height); #ifdef CFTIMER - // now that the grahics context is setup, add this instance to the timer - // list so it gets drawn repeatedly - gRenderTimer.AddInstance(instance); + // now that the grahics context is setup, add this instance to the timer + // list so it gets drawn repeatedly + gRenderTimer.AddInstance(instance); #endif // CFTIMER + } return NPERR_NO_ERROR; } |