Changes

Jump to: navigation, search

Platform/GFX/Moz2D

4,661 bytes added, 06:35, 14 August 2013
Building Moz2D
=== Building Moz2D ===
 
The Moz2D project can be developed independently of the rest of Gecko/Firefox by checking out the [https://hg.mozilla.org/users/bschouten_mozilla.com/moz2d/ dedicated repository]. The steps for each platform follow.
 
==== Linux/Mac ====
 
Depending on which backend you are interested in building, the steps are as follows:
 
===== Cairo =====
 
Dependencies:
 
* libcairo2-dev (http://cairographics.org/download/)
* If you plan on using Player2D, qt4-sdk (http://qt-project.org/downloads)
 
Steps:
 
# Clone the repository: <code>hg clone http://hg.mozilla.org/users/bschouten_mozilla.com/moz2d</code>
# On Mac, add the directory containing the cairo.pc file to your PKG_CONFIG_PATH (if it's not there already).
#* One location seen was /usr/X11/lib/pkgconfig
#* Another location seen was /opt/local/lib/pkgconfig
# Build using one of the following targets:
#* release: <code>make -f Makefile.standalone release MOZ2D_CAIRO=true</code>
#* debug: <code>make -f Makefile.standalone debug MOZ2D_CAIRO=true</code>
#* check: <code>make -f Makefile.standalone check MOZ2D_CAIRO=true</code>
#* player2d: <code>make -f Makefile.standalone player2d MOZ2D_CAIRO=true</code>
 
When building Player2D beware of the following:
 
* Currently you need to be building with clang in order for Player2D to build due to a Qt dependency.
* If you don't get qmake producing a Makefile, but instead get a xcodeproj file instead, you may need to create the Makefile yourself, using qmake options <span style="background:yellow">(details forthcoming)</span> and run make manually.
 
===== Skia =====
 
Dependencies:
 
* Skia:
** <code>svn checkout http://skia.googlecode.com/svn/trunk skia</code>
** Build skia with <code>BUILDTYPE=Release</code>. See https://sites.google.com/site/skiadocs/user-documentation/quick-start-guides/linux
* If you plan on using Player2D, qt4-sdk (http://qt-project.org/downloads)
 
Steps:
 
# Clone the repository: <code>hg clone http://hg.mozilla.org/users/bschouten_mozilla.com/moz2d</code>
# <code>make -f Makefile.standalone clean release MOZ2D_SKIA=skia</code>
# If you didn't checkout skia under the moz2d src directory then set MOZ2D_SKIA to it's relative path
 
==== Windows ====
 
Dependencies:
 
* [http://www.microsoft.com/visualstudio/eng/downloads VS2012], Express 2012 for Windows Desktop is fine
* A default Cairo and Skia build in the cairo/skia directories in the parent directory of Moz2D if you plan to use skia/cairo
 
Steps:
 
# Check out the mercurial repository<code>hg clone http://hg.mozilla.org/users/bschouten_mozilla.com/moz2d</code>
# Open the <code>gfx2d.sln</code> visual studio solution
# Build the solution
#* Build the Debug configuration first since it generates the shader code
#* Don't build Release (Skia) without installing Skia / Cairo first
 
===== Building Player2D =====
 
After building Moz2D, you can build the Player2D project (see below) as follows.
 
Dependencies:
 
* [http://qt-project.org/downloads QtSDK]
** Use the VS2012 32-bit version
** You will need at least version 5.1.0 since earlier versions don't have a 32-bit binary for VS2012 and have a bug ([https://bugreports.qt-project.org/browse/QTBUG-30822 QTBUG-30822]) that cause Visual Studio to pick up the wrong Windows SDK headers when building in an environment with both VS2010 and VS2012 installed.
** Older versions can be used if needed. Use one of the installers and select "Source Components" when installing. Then, from a VS2012 command prompt run:
*** <code>C:\Qt\Qt5.0.2\5.0.2\Src\qtbase> configure -opensource -confirm-license -static -debug-and-release -no-angle -no-opengl -nomake examples -nomake tests -platform win32-msvc2012</code>
*** <code>nmake</code>
*** (Requires [http://www.activestate.com/activeperl Perl])
 
From a VS2012 command prompt:
 
# Go to the <code>moz2d</code> repository clone, <code>cd c:\users\me\moz2d</code>
# <code>mkdir player2d-build</code>
# <code>cd player2d-build</code>
# <code>\qt\Qt5.1.0\5.1.0\msvc2012\bin\qmake.exe ..\player2d\player2d.pro -tp vc -spec win32-msvc2012</code><br>(The final <code>-spec win32-msvc2012</code> might not be necessary, particularly if you only have one version of Visual Studio installed)
# Open the generated <code>player2d.vcxproj</code> file from the <code>player2d-build</code> directory in VS2012.
# Press F7 to build.
# If you get an error about <code>surfaceview.h</code> not being found when referenced from <code>ui_sourcesurfaceview.h</code>, change the line that reads:<br><code>#include &lt;surfaceview.h&gt;</code><br>to<br><code>#include "surfaceview.h"</code>
# Add the directory containing the QT DLLs to your path (e.g. C:\qt\Qt5.1.0\5.1.0\msvc2012\bin)
# Run player2d
=== Testing Moz2D: Player2D ===
Confirm
166
edits

Navigation menu