summaryrefslogtreecommitdiffstats
path: root/o3d/core
Commit message (Collapse)AuthorAgeFilesLines
* Rewrote full-screen support on Windows. O3D now always creates its ownkbr@google.com2009-09-176-82/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add missing gclient dependencies to .gitignore.maruel@chromium.org2009-09-176-631/+631
| | | | | | | | | | | | | | Fix the format of many directories so they don't show up in git status anymore. Run dos2unix on *.cc, caught many inconsistent and CRLF files. TBR=evan TEST=still build, git status shows nothing BUG=none Review URL: http://codereview.chromium.org/211010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26441 0039d316-1c4b-4281-b951-d872f2087c98
* This updated the GYP deps file to the last known good revision of Chrome,gspencer@google.com2009-09-151-1/+1
| | | | | | | | and all the associated third party packages. Review URL: http://codereview.chromium.org/203077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26283 0039d316-1c4b-4281-b951-d872f2087c98
* Review URL: http://codereview.chromium.org/176026rlp@google.com2009-09-153-44/+194
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26273 0039d316-1c4b-4281-b951-d872f2087c98
* Made gyp file for command buffer libraries.apatrick@google.com2009-09-155-13/+58
| | | | | | | | | | | | | | Gyp build works on Windows. Mac and linux won't work yet. Fixed some warnings. Switched from dxerr.lib to dxerr9.lib. Implemented a Texture::SetRect case for DXT compressed textures. Fixed division by zero for zero stride vertex buffers. TEST=none BUG=none Review URL: http://codereview.chromium.org/200127 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26271 0039d316-1c4b-4281-b951-d872f2087c98
* Guess at getting linux build to work.gman@google.com2009-09-102-15/+9
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25948 0039d316-1c4b-4281-b951-d872f2087c98
* missed onegman@google.com2009-09-091-0/+7
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25815 0039d316-1c4b-4281-b951-d872f2087c98
* Make more stuff private in renderergman@google.com2009-09-093-37/+47
| | | | | | Review URL: http://codereview.chromium.org/199066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25805 0039d316-1c4b-4281-b951-d872f2087c98
* Check for value overlow in buffer.ccgman@google.com2009-09-091-0/+7
| | | | | | | | http://b/issue?id=2106717 Review URL: http://codereview.chromium.org/194059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25804 0039d316-1c4b-4281-b951-d872f2087c98
* This fixes some warnings in the Linux release build.bradnelson@google.com2009-09-092-8/+9
| | | | | | Review URL: http://codereview.chromium.org/194061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25802 0039d316-1c4b-4281-b951-d872f2087c98
* minor change of render_surface_test.ccgman@google.com2009-09-091-0/+2
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25774 0039d316-1c4b-4281-b951-d872f2087c98
* Fix for mac/linux unit_testgman@google.com2009-09-091-0/+2
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25772 0039d316-1c4b-4281-b951-d872f2087c98
* Add check for offset + number_of_bytes overflowgman@google.com2009-09-041-2/+4
| | | | | | | | | | | | | | | | | | | | to UPDATE_TEXTURE2D and UPDATE_TEXTURE2D_RECT IMC messages. This was moved from issue 199008 beacuse codereview.chromium.org was giving bogus errors C:\src\o3d_outside_pc\o3d>gcl upload fix Upload server: codereview.chromium.org (change with -s/--server) Email [gman@google.com]: Password for gman@google.com: Saving authentication cookies to C:\Documents and Settings\gman\.codereview_upload_cookies Issue creation errors: {'user': ["You (Gman@google.com) don't own this issue (199008)"]} Review URL: http://codereview.chromium.org/192030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25524 0039d316-1c4b-4281-b951-d872f2087c98
* Make O3D always clear the backbuffer one way or gman@google.com2009-09-0410-88/+186
| | | | | | | | | | | | | | another. The issue is that given that we are using DISCARD on D3D and on GL we are only drawing to the visible portion of the O3D area, the state of the backbuffer is undefined. This change should make it consistent across platforms. Review URL: http://codereview.chromium.org/201013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25522 0039d316-1c4b-4281-b951-d872f2087c98
* This adds in targets for selenium and updated several other problems,gspencer@google.com2009-09-042-14/+31
| | | | | | | | | | | including some problems with the samples and idl generation. Selenium targets launch selenium on all platforms, but the tests don't pass anywhere but Windows yet because the plugin isn't found. I'll work on that next. Review URL: http://codereview.chromium.org/197014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25467 0039d316-1c4b-4281-b951-d872f2087c98
* Get Mac GYP build compiling.maf@google.com2009-09-031-1/+1
| | | | | | Review URL: http://codereview.chromium.org/172119 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25292 0039d316-1c4b-4281-b951-d872f2087c98
* Fixing GYP build. Warning generated by this code was treated as error at ↵vangelis@google.com2009-09-031-1/+1
| | | | | | | | compile time. Review URL: http://codereview.chromium.org/197002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25287 0039d316-1c4b-4281-b951-d872f2087c98
* This CL adds the createRawDataFromDataURL function to o3d.Pack. The functionmstrydom@google.com2009-09-023-0/+34
| | | | | | | | | | takes as input a data URL, decodes the data, and returns the raw data in a RawData object. If the data URL has an invalid format, an error message is displayed. Currently only data URL's encoded in base64 are supported. The mime type is ignored. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25252 0039d316-1c4b-4281-b951-d872f2087c98
* Fixing mac and linux buildvangelis@google.com2009-09-022-4/+6
| | | | | | Review URL: http://codereview.chromium.org/186020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25247 0039d316-1c4b-4281-b951-d872f2087c98
* Fixing path in call to version_info.pybradnelson@google.com2009-09-021-1/+1
| | | | | | | | | | BUG=None TEST=None TBR=gspencer Review URL: http://codereview.chromium.org/185004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25150 0039d316-1c4b-4281-b951-d872f2087c98
* Adds GET_VERSION IMC message.gman@google.com2009-09-029-66/+289
| | | | | | Review URL: http://codereview.chromium.org/180071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25130 0039d316-1c4b-4281-b951-d872f2087c98
* Rename render_width and render_height to display_widthgman@google.com2009-09-014-25/+25
| | | | | | | | | | | | | | and display_height in preparation for letting the user choose the backbuffer size. The issue is the current "render_width" and "render_height" really mean display_width and display_height where as the true "render_width" and "render_height" need to be different. Review URL: http://codereview.chromium.org/179058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25070 0039d316-1c4b-4281-b951-d872f2087c98
* Fix for param array support in effects for GLgman@google.com2009-09-011-1/+2
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25022 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes for texture locking.gman@google.com2009-09-014-11/+5
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25018 0039d316-1c4b-4281-b951-d872f2087c98
* Update Texture::Lock to take an AccessMode.gman@google.com2009-09-0112-311/+378
| | | | | | | | | | | | | | | | | | Also, split Lock/Unlock into common and platform specific parts. This is needed to work around an apparent bug in mac drivers where glGetTexImage apparently doesn't always work. This doesn't solve the issue unless we disallow READ completely. Not sure what to about that except make a small GL sample and report the bug to Apple. Review URL: http://codereview.chromium.org/173640 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25012 0039d316-1c4b-4281-b951-d872f2087c98
* Switching DISPLAY_MODE_DEFAULT to create to a non-full-screen window at the ↵vangelis@google.com2009-08-311-7/+15
| | | | | | | | | | | current display resolution. This makes switching in and out of full screen smoother. A followup CL will allow the application code to specify the max backbuffer size to get cheaper (from the GPU/pixel shader perspective) full screen rendering. Review URL: http://codereview.chromium.org/177007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24940 0039d316-1c4b-4281-b951-d872f2087c98
* Fix for Canvas::DrawBitmap that I broke when addinggman@google.com2009-08-311-1/+1
| | | | | | | | adding pitch to Texture2D::Lock Review URL: http://codereview.chromium.org/177029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24907 0039d316-1c4b-4281-b951-d872f2087c98
* Fix for mac setRect?gman@google.com2009-08-291-0/+4
| | | | | | Review URL: http://codereview.chromium.org/180030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24849 0039d316-1c4b-4281-b951-d872f2087c98
* Fix syntax accessing enum scoped to class, to fix GCC builds.maf@google.com2009-08-281-1/+1
| | | | | | Review URL: http://codereview.chromium.org/183007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24832 0039d316-1c4b-4281-b951-d872f2087c98
* Adding in render surfaces for command buffers. Fixing SetRect as well.rlp@google.com2009-08-289-42/+707
| | | | | | Review URL: http://codereview.chromium.org/160401 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24825 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes toDataURL for GL by making it all work throughgman@google.com2009-08-2820-352/+468
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | O3D. What happens is client.toDataURL creates a RenderSurface and DepthSurface, sets those as the current Surface then renders. It then calls Surface::GetBitmap to get the pixels in the bitmap. The complications are 1) I needed to make Renderer::StartRendering / Renderer::FinishRendering be nestable because the Renderer::SetRenderSurface required StartRendering to already have been called. I didn't see a cleaner way to do this but I'm happy to change it if you have a better idea. 2) Since we can only create POT RenderSurfaces I added a clip_width / clip_height to render surfaces. Renderer::SetViewport uses these values so we end up rendering correctly to the top/left area of the POT render surface. 3) Doing it this way means that screenshots are NOT anti-aliased. I feel like that issue can be handled later. It's more important that toDataURL work now than it have the ultimate best results. (I hope). It probably means I'll need to create all new reference images. 4) I was wondering we we should expose SetClipWidth to JavaScript. Given that we require POT render surfaces they should always get the same results on all hardware. Or, rather, we could just allow the user to create NPOT RenderSurfaces. Under the hood they'd get a POT surface but the clip_width/clip_height would be set to the size the requested. There would have to be a note that texture wrapping only works if the size if POT. 5) I had to split FinishRendering into FinishRendering and Present since when taking a screenshot nothing will be drawn to the backbuffer and so I don't want a present to happen. Review URL: http://codereview.chromium.org/174594 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24781 0039d316-1c4b-4281-b951-d872f2087c98
* temp fix for bug with compressed texture clearinggman@google.com2009-08-271-19/+20
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24631 0039d316-1c4b-4281-b951-d872f2087c98
* Clear textures on creation for D3D because it gman@google.com2009-08-271-0/+41
| | | | | | | | does not Review URL: http://codereview.chromium.org/174530 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24603 0039d316-1c4b-4281-b951-d872f2087c98
* Security fix for DDS files.gman@google.com2009-08-271-0/+9
| | | | | | | | | This CL make it check that the mip_count in the file is a reasonable size. Review URL: http://codereview.chromium.org/174583 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24587 0039d316-1c4b-4281-b951-d872f2087c98
* Adds a RENDER message to the O3D IMC.gman@google.com2009-08-264-0/+141
| | | | | | | | | | | | | | | | | Normally O3D renders as fast as it can but you can put O3D in a render-on-demand mode in which case it will only render when it has to, like when part of the window is uncovered, or when you explicit tell it. Asking it to render does not render immediately, it just marks the plugin in a state of "need to render". The plugin will render at the next available chance. Review URL: http://codereview.chromium.org/174465 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24531 0039d316-1c4b-4281-b951-d872f2087c98
* Fixes for OSX float differences from Windows.gman@google.com2009-08-261-7/+21
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24515 0039d316-1c4b-4281-b951-d872f2087c98
* Changes needed to get everything packaged for Mac.maf@google.com2009-08-261-1/+11
| | | | | | Review URL: http://codereview.chromium.org/173453 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24478 0039d316-1c4b-4281-b951-d872f2087c98
* Created new build target for opengl command buffer service, fixed various ↵petersont@google.com2009-08-265-5/+19
| | | | | | | | bugs in opengl command buffers service code until unit tests passed on windows. Review URL: http://codereview.chromium.org/165279 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24415 0039d316-1c4b-4281-b951-d872f2087c98
* Added a compiler flag to include precompile.h on command line in core on ↵petersont@google.com2009-08-261-0/+1
| | | | | | | | unix builds. Review URL: http://codereview.chromium.org/174485 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24389 0039d316-1c4b-4281-b951-d872f2087c98
* Moved include of precompiled header out of cc files in core to me more in ↵petersont@google.com2009-08-25104-118/+6
| | | | | | | | accordance with styleguide. Review URL: http://codereview.chromium.org/173327 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24375 0039d316-1c4b-4281-b951-d872f2087c98
* Fix for osx Lanzcos scale test.gman@google.com2009-08-251-1/+13
| | | | | | | Apparently it's off by like 1 bit. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24337 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup Renderer.gman@google.com2009-08-2521-344/+403
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I believe there were some mis-understandings about the code. It's supposed to work StartRendering(); BeginDraw(); EndDraw(); BeginDraw(); EndDraw(); BeginDraw(); EndDraw(); FinishRendering(); To try to enforce correct usage I separated some platform dependant stuff from shared stuff and added a few flags. Also in this CL I made Texture::GetRenderSurface not require a pack. This is so I because it feels cleaner that way but also because I wanted to use surfaces without a pack to take a screenshot. Finally I put some screenshot code in for GL. Also fixed some bugs with locking textures. 1) I thought it was x, y, width, height but it's actually x1, y1, x2, y2 2) I was using width in places I should have been using mip_width Review URL: http://codereview.chromium.org/174199 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24188 0039d316-1c4b-4281-b951-d872f2087c98
* Make Mac also look for O3D_FORCE_SOFTWARE_RENDERERgman@google.com2009-08-243-9/+11
| | | | | | | | | | | | | | environment variable. In the Mac version, the place it's added lets one instance use the hardware renderer and another instance use the software renderer. The windows version does this as well. Review URL: http://codereview.chromium.org/173248 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24127 0039d316-1c4b-4281-b951-d872f2087c98
* Changes the Windows backbuffer to RGBA mode.gman@google.com2009-08-212-86/+63
| | | | | | | | | | Note: This requires all new sample reference files which are in another CL and that requires a new pdiff which is in yet another CL Review URL: http://codereview.chromium.org/173182 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23983 0039d316-1c4b-4281-b951-d872f2087c98
* Fix bug where shaders fail if the last // #o3d linegman@google.com2009-08-191-0/+1
| | | | | | | | does not have an end-of-line Review URL: http://codereview.chromium.org/173070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23726 0039d316-1c4b-4281-b951-d872f2087c98
* Changes needed to make "all" build complete, including fixing the generated ↵maf@google.com2009-08-193-21/+27
| | | | | | | | converter tool. Review URL: http://codereview.chromium.org/173045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23721 0039d316-1c4b-4281-b951-d872f2087c98
* Changes to make test project build.maf@google.com2009-08-193-164/+148
| | | | | | Review URL: http://codereview.chromium.org/172081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23692 0039d316-1c4b-4281-b951-d872f2087c98
* Small fix for IMC UPDATE_TEXTURE_2Dgman@google.com2009-08-192-12/+115
| | | | | | Review URL: http://codereview.chromium.org/173036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23688 0039d316-1c4b-4281-b951-d872f2087c98
* Add test for texture::SetRect to make sure -pitchgman@google.com2009-08-191-0/+91
| | | | | | | | works. Review URL: http://codereview.chromium.org/174037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23685 0039d316-1c4b-4281-b951-d872f2087c98
* expose Bitmap to JavaScript.gman@google.com2009-08-1916-282/+982
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also added Texture.drawImage(canvas...) There's still the big question of whether we should flip textures by default in the o3d code. Currently I'm flipping them by default in o3djs.texture.createTextureFromRawData and I'm flipping them by default in o3djs.canvas.CanvasQuad.updateTexture. I'm torn whether or not I should be flipping them. I feel like 2d examples and examples of displaying images, like a picasa viewer, would be simpler if we didn't flip by default but the problem then is if you load some textures through a collada scene they'll be flipped the opposite of any textures you load by hand. Review URL: http://codereview.chromium.org/171060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23678 0039d316-1c4b-4281-b951-d872f2087c98