summaryrefslogtreecommitdiffstats
path: root/o3d/core
Commit message (Collapse)AuthorAgeFilesLines
* Implement fullscreen on Linux. No "Press Esc" message yet though. Also it's ↵tschmelcher@google.com2009-10-013-17/+66
| | | | | | | | | | 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
* Added 32-bit float textures to command buffers, also changed the ↵petersont@google.com2009-09-301-3/+7
| | | | | | | | texture::Format enum to be more like Texture::Format in o3d. Review URL: http://codereview.chromium.org/227011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27644 0039d316-1c4b-4281-b951-d872f2087c98
* Quick fix for skinning translation bug.gman@google.com2009-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | We weren't binding the transform of the skin to the base so the transform was getting applied twice and also the math was wrong in skinning. This is the shortest change to make this work but it is arguably not the *correct* change. The correct change would be to make the import code create Skin separate from ParamArray and SkinEval so that you can use the same Skin data multiple times in the same scene. I don't know enough about collada to know if that's possible to setup in collada but the way the code is structured currently it seems to assume it is even though the code does support this correctly. That would take some work to fix and require samples and it seems unlikely people will run into that issue so this smaller fix seems good enough for now. Review URL: http://codereview.chromium.org/235046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27447 0039d316-1c4b-4281-b951-d872f2087c98
* More work in Command Buffersgman@google.com2009-09-2617-252/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I think/hope this is the last big CL for this. *) Moved GAPIInterface enums to cmd_buffer_format.h The reason is you should not have to include CODE to make data. The fact that the enums were in GAPIInterface, a class, meant you had to include code if you wanted to make a command buffer. *) Typed arguments where I could. So for example Draw takes PrimitiveType instead of uint32. CreateVertexBuffer takes a ResourceId *) Renamed enums etc to match style guide. *) Moved BitFields into specific commands *) renamed arguments from id to type_id. Review URL: http://codereview.chromium.org/234002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27322 0039d316-1c4b-4281-b951-d872f2087c98
* Added command buffer unit tests to gyp.apatrick@google.com2009-09-242-1/+11
| | | | | | | | | | | | | | | | | | | Can optionally override default renderer with environment variable. One of: GYP_DEFINES = "renderer=d3d9" GYP_DEFINES = "renderer=gl" GYP_DEFINES = "renderer=cb cb_service=d3d9" GYP_DEFINES = "renderer=cb cb_service=gl" Fixed some warnings. Works on windows with D3D9 but not GL, mac or linux yet. TEST=none BUG=none Review URL: http://codereview.chromium.org/208037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27125 0039d316-1c4b-4281-b951-d872f2087c98
* Change command buffer client code to use structures.gman@google.com2009-09-2311-368/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I didn't update the big_test although I'm happy to do that in another CL. I changed the CB renderer code to use this. The only place I didn't is the state handling code. I'll consider changing that in another CL. I changed DoCommand so it gets passed the entire command data including the command itself where as it used to get passed the command buffer entry after the command. I wanted to put the commands into the structures as I think it makes them easier to use since they can then correctly set their header. I could have left DoCommand as is but there would have been a lot of funky pointer math and I thought this change made it cleaner. Some questions I had while doing this. There are a few places in the code that use unsigned int instead of uint32. It seems we should use uint32 because unsigned int is not guarnteed to be 32bits. So for example ResourceID is unsigned int right now. The CMD::Set/CMD::Init/CommandBufferHelper commands are currently fairly untyped. For example DESTROY_TEXTURE takes a uint32 id. Should it take a ResourceID instead? DRAW should maybe take an enum for primitive_type? If we decide to do that I'd like to do it in another CL. There's no checking for overflow. We could add a bunch of DCHECK like DCHECK_LE(width, 65536) or DCHECK_LE(semantic_index, 16). I'd like to do those in another CL as well as I think we need to discuss what commands we want to change. All the code is in .h files because we want all of this code to inline. Theoretically this should be just as efficient as poking values into arrays in the opt builds. Review URL: http://codereview.chromium.org/212018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26886 0039d316-1c4b-4281-b951-d872f2087c98
* 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