summaryrefslogtreecommitdiffstats
path: root/o3d/plugin/cross/o3d_glue.h
Commit message (Collapse)AuthorAgeFilesLines
* Moving o3d up a level, to get it out of chrome checkouts.bradnelson@google.com2011-03-281-568/+0
| | | | | | | | | | BUG=None TEST=None Too large for codereview. Manual review by thaloun and tschelcher. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79609 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting the parts of r79524.bradnelson@google.com2011-03-281-1/+1
| | | | | | | | | | | | | O3D is using a pinned version of base. Typically you don't need to update it (and in fact shouldn't) on changes to base. BUG=None TEST=None R=levin@chromium.org Review URL: http://codereview.chromium.org/6757008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79578 0039d316-1c4b-4281-b951-d872f2087c98
* Move some files from base to base/memory.levin@chromium.org2011-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | raw_scoped_refptr_mismatch_checker.h ref_counted.cc ref_counted.h ref_counted_memory.cc ref_counted_memory.h ref_counted_unittest.cc scoped_callback_factory.h scoped_comptr_win.h scoped_handle.h scoped_native_library.cc scoped_native_library.h scoped_native_library_unittest.cc scoped_nsobject.h scoped_open_process.h scoped_ptr.h scoped_ptr_unittest.cc scoped_temp_dir.cc scoped_temp_dir.h scoped_temp_dir_unittest.cc scoped_vector.h singleton.h singleton_objc.h singleton_unittest.cc linked_ptr.h linked_ptr_unittest.cc weak_ptr.cc weak_ptr.h weak_ptr_unittest.cc BUG=None TEST=Compile Review URL: http://codereview.chromium.org/6714032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79524 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for Core Graphics with Carbon, allowing us to use Core Graphics ↵tschmelcher@google.com2011-03-081-0/+1
| | | | | | | | | | | | | in Firefox (since it does not support Cocoa). This lets us use O2D in FF without porting it to Quickdraw. Also tweak the drawing model behaviour so that we select the best possible model for the requested RenderMode. TEST=RenderMode=Auto and =2D in FF on an MBP6,2 and verified 2D avoids issues with the dynamic GPU switching feature of that hardware; RenderMode=2D in Chrome and Safari BUG=none Review URL: http://codereview.chromium.org/6626059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77223 0039d316-1c4b-4281-b951-d872f2087c98
* Port O2D to Mac, currently just for Core Graphics (the drawing model used in ↵tschmelcher@chromium.org2011-03-031-3/+3
| | | | | | | | | | | 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
* Prevents changing the stored tab handle at switching tabs. This fixes a bug ↵geer@google.com2010-09-161-1/+1
| | | | | | | | | | where O3D would keep rendering on another tab in Safari on OSX 10.5.8. When the area had been clicked before switching tabs, a lost focus event just before switching would reset the stored handle to the new, non-O3D tab. Also fixes the tab detection after the o3d page has been dragged to another window. Review URL: http://codereview.chromium.org/3317018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59628 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor AsyncTick to force Chrome through the reentrancy checks formerly in ↵tschmelcher@chromium.org2010-07-081-0/+6
| | | | | | | | | | | | | TickPluginObject, which fixes crashes in Chrome on Windows due to reentrant calls to NPP_URLNotify(). Also fix a bug where pending_ticks_ was not decremented in the reentrancy failure path, which would have caused all future AsyncTick() calls to be ignored. TEST=repeatedly loaded O3D in Chrome on Windows dozens of times and verified no crashes, whereas previously these crashes were frequent on this machine BUG=none Review URL: http://codereview.chromium.org/2824050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51911 0039d316-1c4b-4281-b951-d872f2087c98
* Fix issue where concurrent access to V8 from different threads resulted in ↵tschmelcher@chromium.org2010-06-281-4/+0
| | | | | | | | | | | | | crashes. V8 is not reentrant (yet), so the recommended solution is to globally lock V8 whenever doing anything with it. In practice this was only an issue in IE, perhaps because that is the only browser that uses different threads for different plugin instances within the same process. Also change some unused public methods to private. TEST=concurrent running/loading/playing of the Simple Scene Viewer, checkers.html, 2d.html, box2d-3d, and the pool app, all in both Win IE and Win Chrome BUG=none Review URL: http://codereview.chromium.org/2844026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51073 0039d316-1c4b-4281-b951-d872f2087c98
* Implemented full-screen support for Core Graphics and Core Animationkbr@google.com2010-05-241-5/+31
| | | | | | | | | | | | | | | | | | | | | | rendering models using a top-level NSWindow and rendering to an NSOpenGLContext which shares resources with the CGLContextObj used to render into the plugin region. Synthesizes and dispatches NPCocoaEvents for the mouse, keyboard and focus change events received by the window. Exposed primitives needed to reset state in the OpenGL context and to switch the Renderer's notion of the context. Fixed bug in offscreen rendering support previously added in support of Core Graphics drawing model. Tested with full-screen sample and modified render-mode sample on Mac OS X 10.6 in Safari 4 and on Mac OS X 10.5 with a version of Chromium with the O3D blacklist entry removed. BUG=http://code.google.com/p/o3d/issues/detail?id=221 TEST=none Review URL: http://codereview.chromium.org/2095023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48076 0039d316-1c4b-4281-b951-d872f2087c98
* Refactored full-screen code under FullscreenWindowMac base class andkbr@google.com2010-05-191-25/+20
| | | | | | | | | | | | | | | | | overlay window code into OverlayWindowMac class. This is an intermediate step toward a Cocoa and CGL implementation. Verified that mouse and key events continue to work in full-screen mode with full-screen sample and a modified render-mode.html in Firefox 3.6.3 on Mac OS X, where O3D continues to use the Quickdraw drawing model. BUG=http://code.google.com/p/o3d/issues/detail?id=221 TEST=none Review URL: http://codereview.chromium.org/2129015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47733 0039d316-1c4b-4281-b951-d872f2087c98
* Review URL: http://codereview.chromium.org/577038maf@google.com2010-04-131-0/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44397 0039d316-1c4b-4281-b951-d872f2087c98
* Added support for O3D in Chrome on Mac OS X using CoreGraphics drawingkbr@chromium.org2010-03-111-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | model by rendering offscreen, reading back the frame buffer, and drawing the rendering results into the CGContextRef. This code path is currently Chrome-specific, but could be used for any browser with similar characteristics. This will require refactoring of the drawing and event model selection code, which may be done in a subsequent bug. Changed the RenderSurface APIs to allow the Bitmap for readback to be passed in. Added Client::SetOffscreenRenderingSurfaces so that the entry point Client::RenderClient() can be used unchanged. Fixed problem with plugin_enable_fullscreen_msg gyp variable which needs to be in top-level gypi so #define is consistent throughout project. Fixed minor issue in Cocoa key event handling. Fixed log message causing crashes when render target attachment fails. Chrome currently blacklists the O3D plugin's MIME type, so to enable support for O3D this blacklist entry needs to be removed from Chrome. Ran nearly all O3D samples in Chrome on Mac OS X. There are a couple of failures which will be fixed in subsequent bugs. Also ran samples in Safari and Firefox on Mac and verified no performance regressions. BUG=http://code.google.com/p/o3d/issues/detail?id=215 TEST=ran O3D samples in Chrome, Safari and Firefox Review URL: http://codereview.chromium.org/669220 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41233 0039d316-1c4b-4281-b951-d872f2087c98
* Introduce two new GYP variables:tschmelcher@chromium.org2010-03-051-1/+7
| | | | | | | | | | | | | 1) plugin_domain_whitelist, which sets an optional domain whitelist. If specified, websites not in the list can't use the plugin. 2) plugin_enable_fullscreen_msg, which can be optionally unset to disable the Win/Mac fullscreen message. Also fix a bug in NPPluginProxy that this uncovered. TEST=built on Windows with a whitelist and without fullscreen message and verified correct behaviour in both IE and FF. Also, the whitelist logic comes almost verbatim from another Google product where it is already well-tested BUG=none Review URL: http://codereview.chromium.org/668078 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40786 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: make sure the fullscreen window always gets focustschmelcher@chromium.org2010-02-221-0/+4
| | | | | | | | | TEST=tested fullscreen on Linux with metacity, metacity + focus-follows-mouse, compiz, compiz + focus-follows-mouse BUG=none Review URL: http://codereview.chromium.org/652076 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39651 0039d316-1c4b-4281-b951-d872f2087c98
* linux: native OpenGL ES supportpiman@google.com2010-02-081-1/+1
| | | | | | | | | This includes Gregg's CL 548023 There are still a few hard-coded paths, and issues to solve, but hellocube-textures-glsl is running on an actual device. Review URL: http://codereview.chromium.org/572029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38385 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: fix crash in Firefox at plugin unload time when more than one O3D ↵tschmelcher@chromium.org2010-01-201-0/+1
| | | | | | | | | | | | instance is running. The problem here was that Firefox has a bug where closing a tab actually deletes the parent windows of the plugin _before_ calling NPP_Destroy(), and Gtk recursively destroys all children automatically. Hence, once NPP_Destroy() runs our X11 Window handle is already invalid. If there is another O3D instance running in the same browser process, then performing the TearDown() call requires a MakeCurrent() call on the Window handle, which will fail with GLXBadDrawable and kill the browser. The solution requires two things. First, to avoid Gtk recursively destroying the children, we explicitly open a separate X11 connection for our GtkPlug, which means a destroy on the parents does not automatically propagate to the children because it has to go through the X server first. Second, we register a callback with our GtkPlug to handle this event from the X server by turning our GtkPlug into a hidden unparented window rather than destroying it. Unrelatedly, also make fullscreen windows be set_keep_above and fix some spurious unref() calls (which produced warnings but otherwise were mostly harmless). TEST=opening and closing concurrent ping pong windows in FF and Chrome (64-bit) Review URL: http://codereview.chromium.org/553028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36650 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: implement setting cursor typetschmelcher@chromium.org2010-01-081-1/+5
| | | | | | Review URL: http://codereview.chromium.org/527024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35764 0039d316-1c4b-4281-b951-d872f2087c98
* Switched from NPObject shared memory wrapper to Chrome shared memory in ↵apatrick@google.com2009-11-101-0/+11
| | | | | | | | | | | preparation for moving from NPAPI to Chrome IPC for synchronous messages. Started work on an O3D configuration that will use Pepper 3D to connect to a remote GPU plugin. This is not building yet. Updated to latest NPAPI from nixysa. Review URL: http://codereview.chromium.org/371074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31519 0039d316-1c4b-4281-b951-d872f2087c98
* Implement fullscreen on Linux. No "Press Esc" message yet though. Also it's ↵tschmelcher@google.com2009-10-011-5/+15
| | | | | | | | | | DISPLAY_MODE_DEFAULT only for now (mode switching is evil anyways ;) ). Small bit of code cleanup in renderer.h. TESTED=entered and exited fullscreen; tested leaving with Esc, Alt+F4, click on region, and right-click on taskbare -> Close; all with both Compiz on and off, on gHardy. Review URL: http://codereview.chromium.org/258004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27732 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed Mac gyp build. Switched to using Chrome hash_tables.h, changedkbr@google.com2009-09-261-4/+39
| | | | | | | | | | | | | | | how hash functions are specified for certain key types, and deleted our std_hash.h. Fixed forward reference bug in cmd_buffer_format.h. Built and tested on Windows and Mac. Remaining workarounds: enabled C++ exceptions due to use of Objective C try/catch in plugin_mac.mm; disabled warnings as errors due to signed / unsigned issues in command buffer code, which will probably need to be fixed by changing typedefs and argument types. Review URL: http://codereview.chromium.org/249013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27311 0039d316-1c4b-4281-b951-d872f2087c98
* Rewrote full-screen support on Windows. O3D now always creates its ownkbr@google.com2009-09-171-23/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | window in which to render, rather than rendering into either the browser's window or a separate full-screen window. The O3D window is removed from the browser's hierarchy and made top-level in order to go to full-screen mode via Direct3D. This solves fundamental focus fighting problems seen on Windows Vista. This change allowed the event forwarding code in the plugin's window message loop to be deleted, but a new workaround for a flicker upon the first mouse click in O3D in Firefox was required. Split the Renderer's fullscreen API into GoFullscreen and CancelFullscreen to solve chicken-and-egg problems with coming out of full-screen mode. Changed how the plugin detects resize events. Rather than responding to WM_SIZE messages, NPP_SetWindow is now responsible for propagating resize events to the client. Changed the ActiveX host control to call NPP_SetWindow in response to SetObjectRects. Fixed RendererGL::IsCurrent() on non-Mac platforms. Removed the bogus current_renderer_ static variable. Tested the following scenarios in IE and Firefox on Windows: - Full-screen involving display mode change, Escape to exit. - Full-screen involving display mode change, Alt-Tab to exit. - Full-screen involving display mode change, Alt-F4 to exit. - Full-screen involving display mode change, timeout to exit. - Full-screen with no display mode change, Escape to exit. - Full-screen with no display mode change, Alt-Tab to exit. - Full-screen with no display mode change, Alt-F4 to exit. - Full-screen with no display mode change, timeout to exit. - Beach demo, particle demo, other tests. Tested the following scenarios on the Mac in Safari (for which the code path didn't change): - Full-screen, escape to exit. - Full-screen, Alt-Tab to exit. - Full-screen, timeout to exit. When http://crbug.com/21921 is fixed, full-screen mode will work on Windows Vista with Aero on in Chrome. Review URL: http://codereview.chromium.org/210005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26489 0039d316-1c4b-4281-b951-d872f2087c98
* A step in exposing Bitmap to JavaScript.gman@google.com2009-08-061-0/+1
| | | | | | | | | | | | | | | | | | | | | The plan is to make pack.createBitmapFromRawData return an array of bitmaps. 1 bitmap if it's a standard 2d image 6 bitmaps if it's a cubemap N bitmaps if it's a volume map. The bitmaps will have a semantic so you can look at them and tell they were from a volumemap, a cubemap or a 2d image. On the way I'm attempting to clean up the code. Moving stuff out of Bitmap the did not belong there and Refactoring Bitmap so there are less If Format = stuff. Review URL: http://codereview.chromium.org/164034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22583 0039d316-1c4b-4281-b951-d872f2087c98
* Asynchronous tick now uses NPN_PluginAsyncCall.URL streaming callbacks are ↵apatrick@google.com2009-08-031-0/+3
| | | | | | | | now also asynchronous.Implemented NPN_PluginAsyncCall for IE.Allowed WM_PAINT handler to be reentered because it no longer calls into the browser (except to schedule an asynchronous tick if none is pending).Fixed a bug where the EventManager would crash if an event callback called cleanUp on the client.Cleanup destroys all the packs. Doing this in NPP_Destroy seems to make Chrome timeout and fail to load the next page.Tar and GZ decoding happens on a new thread. Review URL: http://codereview.chromium.org/155733 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22305 0039d316-1c4b-4281-b951-d872f2087c98
* This updates the DEPS to bring them in line with the versionsgspencer@google.com2009-07-231-1/+1
| | | | | | | | | | | that Chrome is currently using, and it removes "files" from the NPAPI include paths and file location in third_party so that we can be consistent with other Chrome third party directories. TEST=build using gyp and scons and ran unit tests on each. Review URL: http://codereview.chromium.org/159277 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21415 0039d316-1c4b-4281-b951-d872f2087c98
* Plugin no longer makes synchronous NPAPI calls from a Windows message ↵apatrick@google.com2009-07-131-7/+9
| | | | | | | | handler. This fixes deadlocks and slowdown in Chrome. The approach is strange. It asynchronously opens the url data:, and then invokes Tick from the finish callback. This is the simplest approach I could think of that hide widespread browser support. NPN_PluginThreadAsyncCall would be ideal but it is supported by all browsers we currently support. Review URL: http://codereview.chromium.org/149415 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20517 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed full screen window class issues.apatrick@google.com2009-07-131-5/+0
| | | | | | | | | Now main_win.cc unregisters the full screen window class so that if the DLL is reloaded at a different address later, the WindowProc will point at the new address. Also now using the DLL's module handle rather than the one associated with the plugin (which will likely be the browser exes handle). Review URL: http://codereview.chromium.org/149496 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20500 0039d316-1c4b-4281-b951-d872f2087c98
* fix for osxgman@google.com2009-07-101-1/+1
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20346 0039d316-1c4b-4281-b951-d872f2087c98
* Add ClientInfogman@google.com2009-07-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows an app to ask a few things from the client. 1) How many objects the client is tracking. This is useful for a quick way to check that you're freeing resources. While the developer could use client.objects.length or client.packs[ii].objects.length that wouldend up creating hundreds of thousands of NPObjects. 2) Check if the software renderer is being used 3) Check the approximate amount of memory used by textures. Again, they could compute this with client.getObjectsByClassName('o3d.Texture') but it seemed like it might be useful. I say approximate because I would have to dig down into the indivdual renderers to get better info since a NPOT card will use more memory but it didn't seem worth it. 4) check the approximate amount of memory used by hardware buffers. Review URL: http://codereview.chromium.org/155276 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20334 0039d316-1c4b-4281-b951-d872f2087c98
* add XEmbed bindingspiman@google.com2009-06-291-1/+10
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19508 0039d316-1c4b-4281-b951-d872f2087c98
* New user experience for the fullscreen message on Mac.maf@google.com2009-06-251-5/+13
| | | | | | | It's now a translucent window that slides down into the top right of the screen, hangs around for a while and then slides up up and away. Review URL: http://codereview.chromium.org/147135 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19300 0039d316-1c4b-4281-b951-d872f2087c98
* Add Mac support for setting plugin fullscreen area. maf@google.com2009-06-191-0/+3
| | | | | | Review URL: http://codereview.chromium.org/126252 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18847 0039d316-1c4b-4281-b951-d872f2087c98
* Polish full-screen mode a bit:ericu@google.com2009-06-161-9/+3
| | | | | | | | | | | | | * Add a just-use-the-current-display-mode flag. * Make the sample use more parts of the API. * Correct the spelling of full-screen as per Google's policy. * Check for valid mode when the user gives it to us. * Expose clearFullscreenClickRegion to JS. * Fix a typo in convolution while I'm in there. Review URL: http://codereview.chromium.org/126034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18477 0039d316-1c4b-4281-b951-d872f2087c98
* Make O3D fullscreen mode support resolution switching on Mac.maf@google.com2009-06-101-0/+1
| | | | | | | | First cut - a bit glitchy when leaving fullscreen currently as we get unwanted browser window resizing when the resolution requested is lower than the current window size. Review URL: http://codereview.chromium.org/118471 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18013 0039d316-1c4b-4281-b951-d872f2087c98
* This is the O3D source tree's initial commit to the Chromium tree. It gspencer@google.com2009-05-271-0/+430
is not built or referenced at all by the chrome build yet, and doesn't yet build in it's new home. We'll change that shortly. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17035 0039d316-1c4b-4281-b951-d872f2087c98