Merge pull request #616 from dumganhar/blackberry

add Blackberry port, support Playbook Tablet
This commit is contained in:
minggo 2011-12-12 00:58:11 -08:00
commit aea75de4cf
519 changed files with 64223 additions and 41 deletions

5
.gitignore vendored
View File

@ -54,7 +54,10 @@ xcschememanagement.plist
build/
.DS_Store
# Ignore files build by bada
# Ignore files built by bada
.Simulator-Debug/
.Target-Debug/
.Target-Release/
# Ignore files built by blackberry
Simulator/

View File

@ -21,6 +21,7 @@
#include <climits>
#include <cstring>
#include <memory>
using namespace std;
int32 b2BlockAllocator::s_blockSizes[b2_blockSizes] =

View File

@ -30,6 +30,9 @@
#include <cstddef>
#include <limits>
using namespace std;
/// This function is used to ensure that a floating point number is
/// not a NaN or infinity.
inline bool b2IsValid(float32 x)

View File

@ -23,6 +23,11 @@
#ifdef SHP
#include <FBaseSys.h>
#endif
using namespace std;
b2Version b2_version = {2, 2, 1};
// Memory allocators. Modify these to use your own allocator.

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<bada>
<type>0</type>
<sdk>C:\bada\1.0.0</sdk>
<sdk>E:\bada\1.0.0</sdk>
<model>Wave_LP2</model>
<properties/>
</bada>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<bada>
<type>0</type>
<sdk>e:\bada\2.0.2</sdk>
<sdk>E:\bada\2.0.2</sdk>
<model>WaveWVGA</model>
<apiversioncheck>true</apiversioncheck>
<priviligecheck>false</priviligecheck>

460
Box2D/proj.qnx/.cproject Normal file
View File

@ -0,0 +1,460 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.qnx.qcc.configuration.staticLib.debug.1325368295">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.debug.1325368295" moduleId="org.eclipse.cdt.core.settings" name="Device-Debug">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/Box2D"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/Box2D/Device-Debug"/>
<entry flags="RESOLVED" kind="libraryFile" name="Box2D"/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.debug.1325368295" name="Device-Debug" parent="com.qnx.qcc.configuration.staticLib.debug">
<folderInfo id="com.qnx.qcc.configuration.staticLib.debug.1325368295." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.staticLib.debug.1313767973" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<option id="com.qnx.qcc.option.cpu.476225075" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.435336173" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/Box2D/Device-Debug}" id="com.qnx.nto.513628650" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.1781806562" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.219404271" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.1082268409" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.782887757" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.511453289" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../../"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.501697723" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.1200721818" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.930031340" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.151927713" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.62330070" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.170995741" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.963764234" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.438967752" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.1012398324" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
</tool>
<tool id="com.qnx.qcc.tool.archiver.2107028144" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Collision"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Common"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Dynamics"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Rope"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.staticLib.release.1751821339">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.release.1751821339" moduleId="org.eclipse.cdt.core.settings" name="Device-Release">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/Box2D"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/Box2D/Device-Release"/>
<entry flags="RESOLVED" kind="libraryFile" name="Box2D"/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.release.1751821339" name="Device-Release" parent="com.qnx.qcc.configuration.staticLib.release">
<folderInfo id="com.qnx.qcc.configuration.staticLib.release.1751821339." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.staticLib.release.245188888" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<option id="com.qnx.qcc.option.cpu.1899920152" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1357693757" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/Box2D/Device-Release}" id="com.qnx.nto.108427481" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.1301033997" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compiler.optlevel.1454373594" name="Optimization Level" superClass="com.qnx.qcc.option.compiler.optlevel" value="com.qnx.qcc.option.compiler.optlevel.2" valueType="enumerated"/>
<option id="com.qnx.qcc.option.compiler.security.1250268639" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.1083818888" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.pie.1200407068" name="Position Independent Executable (-fPIE)" superClass="com.qnx.qcc.option.compiler.pie" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.includePath.524835884" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../../"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.1144257796" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.822403234" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<inputType id="com.qnx.qcc.inputType.assembler.1984956914" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.1302207380" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.langcpp.2101623588" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.1178583854" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.pie.138431780" name="Position Independent Executable (-pie)" superClass="com.qnx.qcc.option.linker.pie" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.829497526" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
</tool>
<tool id="com.qnx.qcc.tool.archiver.202751226" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Collision"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Common"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Dynamics"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Rope"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.staticLib.profile.2144964085">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.profile.2144964085" moduleId="org.eclipse.cdt.core.settings" name="Device-Profile">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/Box2D"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/Box2D/Device-Profile"/>
<entry flags="RESOLVED" kind="libraryFile" name="Box2D"/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.profile,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build for Profiling" id="com.qnx.qcc.configuration.staticLib.profile.2144964085" name="Device-Profile" parent="com.qnx.qcc.configuration.staticLib.profile">
<folderInfo id="com.qnx.qcc.configuration.staticLib.profile.2144964085." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.staticLib.profile.1151556318" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<option id="com.qnx.qcc.option.cpu.2057614296" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1452017062" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/Box2D/Device-Profile}" id="com.qnx.nto.1406669210" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.310470410" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.1846714418" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.profile2.261822601" name="Build for Profiling (Function Instrumentation) (-finstrument-functions)" superClass="com.qnx.qcc.option.compiler.profile2" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.923321398" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.685307316" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.1407632228" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../../"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.2054147847" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.398814674" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.229482579" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.86615331" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.706576494" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.1358612147" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.profile2.479475026" name="Build for Profiling (Function Instrumentation) (-lprofiling)" superClass="com.qnx.qcc.option.linker.profile2" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.1155998871" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.1953052653" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.1764929070" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
</tool>
<tool id="com.qnx.qcc.tool.archiver.1262708546" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Collision"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Common"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Dynamics"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Rope"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.staticLib.coverage.1943191253">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.coverage.1943191253" moduleId="org.eclipse.cdt.core.settings" name="Device-Coverage">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/Box2D"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/Box2D/Device-Coverage"/>
<entry flags="RESOLVED" kind="libraryFile" name="Box2D"/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.coverage,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build with Code Coverage" id="com.qnx.qcc.configuration.staticLib.coverage.1943191253" name="Device-Coverage" parent="com.qnx.qcc.configuration.staticLib.coverage">
<folderInfo id="com.qnx.qcc.configuration.staticLib.coverage.1943191253." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.staticLib.coverage.1042480071" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<option id="com.qnx.qcc.option.cpu.1955176635" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.104080494" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/Box2D/Device-Coverage}" id="com.qnx.nto.511204502" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.695022321" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.270536106" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.coverage.1257902614" name="Build for Code Coverage (-Wc,-ftest-coverage -Wc,-fprofile-arcs)" superClass="com.qnx.qcc.option.compiler.coverage" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.1013746750" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.550265575" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.1567489840" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../../"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.1486734612" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.1847014074" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.1037424661" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.1813247763" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.1043032450" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.1348248632" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.coverage.1679203939" name="Build for Code Coverage (-ftest-coverage -fprofile-arcs -p)" superClass="com.qnx.qcc.option.linker.coverage" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.804467119" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.972708644" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.1650220827" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
</tool>
<tool id="com.qnx.qcc.tool.archiver.2080519447" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Collision"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Common"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Dynamics"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Rope"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.staticLib.debug.598508614">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.debug.598508614" moduleId="org.eclipse.cdt.core.settings" name="Simulator">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/Box2D"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/Box2D/Simulator"/>
<entry flags="RESOLVED" kind="libraryFile" name="Box2D"/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.debug.598508614" name="Simulator" parent="com.qnx.qcc.configuration.staticLib.debug">
<folderInfo id="com.qnx.qcc.configuration.staticLib.debug.598508614." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.staticLib.debug.1084652321" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1131533805" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/Box2D/Simulator}" id="com.qnx.nto.43665506" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.1453664708" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.442079704" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.1037091498" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.2097460117" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.336915604" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../../"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.323201008" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.1212187847" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.1947128319" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.134171174" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.1987075711" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.401617884" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.1943198540" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.1072746656" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.1909407490" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
</tool>
<tool id="com.qnx.qcc.tool.archiver.1147608486" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Collision"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Common"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Dynamics"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Rope"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.staticLib.profile.1859315817">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.profile.1859315817" moduleId="org.eclipse.cdt.core.settings" name="Simulator-Profile">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/Box2D"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/Box2D/Simulator-Profile"/>
<entry flags="RESOLVED" kind="libraryFile" name="Box2D"/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.profile,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build for Profiling" id="com.qnx.qcc.configuration.staticLib.profile.1859315817" name="Simulator-Profile" parent="com.qnx.qcc.configuration.staticLib.profile">
<folderInfo id="com.qnx.qcc.configuration.staticLib.profile.1859315817." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.staticLib.profile.492984335" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.508503974" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/Box2D/Simulator-Profile}" id="com.qnx.nto.1982311992" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.185132119" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.1204233844" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.profile2.731650613" name="Build for Profiling (Function Instrumentation) (-finstrument-functions)" superClass="com.qnx.qcc.option.compiler.profile2" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.1585868560" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.910592970" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.1859748069" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../../"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.1852645041" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.773261257" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.1761915363" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.912767515" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.440394940" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.1435055649" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.profile2.2105604390" name="Build for Profiling (Function Instrumentation) (-lprofiling)" superClass="com.qnx.qcc.option.linker.profile2" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.40765482" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.980862349" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.1386316246" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
</tool>
<tool id="com.qnx.qcc.tool.archiver.1844582949" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Collision"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Common"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Dynamics"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Rope"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.staticLib.coverage.1380945475">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.coverage.1380945475" moduleId="org.eclipse.cdt.core.settings" name="Simulator-Coverage">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/Box2D"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/Box2D/Simulator-Coverage"/>
<entry flags="RESOLVED" kind="libraryFile" name="Box2D"/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.coverage,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build with Code Coverage" id="com.qnx.qcc.configuration.staticLib.coverage.1380945475" name="Simulator-Coverage" parent="com.qnx.qcc.configuration.staticLib.coverage">
<folderInfo id="com.qnx.qcc.configuration.staticLib.coverage.1380945475." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.staticLib.coverage.1343178586" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.2027223976" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/Box2D/Simulator-Coverage}" id="com.qnx.nto.1811427128" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.1851607432" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.681756134" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.coverage.387331607" name="Build for Code Coverage (-Wc,-ftest-coverage -Wc,-fprofile-arcs)" superClass="com.qnx.qcc.option.compiler.coverage" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.425554066" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.238549369" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.2146584979" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../../"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.1157336165" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.1381962741" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.1768877658" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.417359742" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.1951217023" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.60515141" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.coverage.580386412" name="Build for Code Coverage (-ftest-coverage -fprofile-arcs -p)" superClass="com.qnx.qcc.option.linker.coverage" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.37902659" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.1696820265" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.2071156412" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
</tool>
<tool id="com.qnx.qcc.tool.archiver.441223992" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Collision"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Common"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Dynamics"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Rope"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="Box2D.null.1362836091" name="Box2D"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.coverage.1380945475">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.debug.598508614">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.debug.1325368295">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.release.1751821339">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.coverage.1943191253">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.profile.1859315817">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.profile.2144964085">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="refreshScope"/>
</cproject>

99
Box2D/proj.qnx/.project Normal file
View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Box2D</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
<value>${workspace_loc:/Box2D/Device-Release}</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>com.qnx.tools.ide.bbt.core.bbtnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
</natures>
<linkedResources>
<link>
<name>Collision</name>
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOC/Collision</locationURI>
</link>
<link>
<name>Common</name>
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOC/Common</locationURI>
</link>
<link>
<name>Dynamics</name>
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOC/Dynamics</locationURI>
</link>
<link>
<name>Rope</name>
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOC/Rope</locationURI>
</link>
</linkedResources>
</projectDescription>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<bada>
<type>0</type>
<sdk>C:\bada\1.0.0</sdk>
<sdk>E:\bada\1.0.0</sdk>
<model>Wave_LP2</model>
<properties/>
</bada>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<bada>
<type>0</type>
<sdk>e:\bada\2.0.2</sdk>
<sdk>E:\bada\2.0.2</sdk>
<model>WaveWVGA</model>
<apiversioncheck>true</apiversioncheck>
<priviligecheck>false</priviligecheck>

View File

@ -0,0 +1,516 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.qnx.qcc.configuration.sharedLib.debug.1659124577">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.sharedLib.debug.1659124577" moduleId="org.eclipse.cdt.core.settings" name="Device-Debug">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/CocosDenshion"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/CocosDenshion/Device-Debug"/>
<entry flags="RESOLVED" kind="libraryFile" name="CocosDenshion"/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="com.qnx.tools.ide.qde.core.QDELinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="so" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" description="" id="com.qnx.qcc.configuration.sharedLib.debug.1659124577" name="Device-Debug" parent="com.qnx.qcc.configuration.sharedLib.debug">
<folderInfo id="com.qnx.qcc.configuration.sharedLib.debug.1659124577." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.sharedLib.debug.1864966678" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<option id="com.qnx.qcc.option.cpu.861291083" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.687898936" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/CocosDenshion/Device-Debug}" id="com.qnx.nto.846702273" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto">
<outputEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Device-Debug"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Device-Release"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Device-Profile"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Device-Coverage"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Simulator"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Simulator-Profile"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="Simulator-Coverage"/>
</outputEntries>
</builder>
<tool id="com.qnx.qcc.tool.compiler.518322297" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compiler.shared.61793642" name="Shared (-shared)" superClass="com.qnx.qcc.option.compiler.shared" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compile.debug.823564566" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.879054085" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.418096557" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.4424722" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../include"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.1849571146" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.699645133" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.515710874" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.assembler.includePath.433672911" name="Include Directories (-I)" superClass="com.qnx.qcc.option.assembler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="E:/blackberry/bbndk-1.0/target/qnx6/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="E:/blackberry/bbndk-1.0/target/target-override/usr/include"/>
<listOptionValue builtIn="false" value="F:/Project/dumganhar/cocos2d-x/CocosDenshion/include"/>
</option>
<option id="com.qnx.qcc.option.assembler.defines.1299555516" name="Defines (-D)" superClass="com.qnx.qcc.option.assembler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<inputType id="com.qnx.qcc.inputType.assembler.1786367549" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.613371239" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.1665213566" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.shared.1713352495" name="Shared (-shared)" superClass="com.qnx.qcc.option.linker.shared" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.1317149184" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.1575313632" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.1420758037" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths"/>
<inputType id="com.qnx.qcc.inputType.linker.1016187136" superClass="com.qnx.qcc.inputType.linker">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
<additionalInput kind="additionaldependency" paths="$(LIB_DEPS)"/>
</inputType>
</tool>
<tool id="com.qnx.qcc.tool.archiver.2113183772" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="qnx"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.sharedLib.release.1714403537">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.sharedLib.release.1714403537" moduleId="org.eclipse.cdt.core.settings" name="Device-Release">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/CocosDenshion"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/CocosDenshion/Device-Release"/>
<entry flags="RESOLVED" kind="libraryFile" name="CocosDenshion"/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="com.qnx.tools.ide.qde.core.QDELinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="so" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" description="" id="com.qnx.qcc.configuration.sharedLib.release.1714403537" name="Device-Release" parent="com.qnx.qcc.configuration.sharedLib.release">
<folderInfo id="com.qnx.qcc.configuration.sharedLib.release.1714403537." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.sharedLib.release.1236437867" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<option id="com.qnx.qcc.option.cpu.618829557" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1557348017" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/CocosDenshion/Device-Release}" id="com.qnx.nto.1315156259" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.2055720937" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compiler.shared.300244130" name="Shared (-shared)" superClass="com.qnx.qcc.option.compiler.shared" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.optlevel.1571383965" name="Optimization Level" superClass="com.qnx.qcc.option.compiler.optlevel" value="com.qnx.qcc.option.compiler.optlevel.2" valueType="enumerated"/>
<option id="com.qnx.qcc.option.compiler.security.1372664386" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.413789958" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.1455383152" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../include"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.82187465" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.889373272" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<inputType id="com.qnx.qcc.inputType.assembler.1121111342" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.805727990" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.shared.1754836136" name="Shared (-shared)" superClass="com.qnx.qcc.option.linker.shared" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.1665542622" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.243572529" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.1451935319" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
<inputType id="com.qnx.qcc.inputType.linker.1229269101" superClass="com.qnx.qcc.inputType.linker">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
<additionalInput kind="additionaldependency" paths="$(LIB_DEPS)"/>
</inputType>
</tool>
<tool id="com.qnx.qcc.tool.archiver.838668895" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="qnx"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.sharedLib.profile.567812986">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.sharedLib.profile.567812986" moduleId="org.eclipse.cdt.core.settings" name="Device-Profile">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/CocosDenshion"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/CocosDenshion/Device-Profile"/>
<entry flags="RESOLVED" kind="libraryFile" name="CocosDenshion"/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="com.qnx.tools.ide.qde.core.QDELinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="so" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.profile,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" description="Build for Profiling" id="com.qnx.qcc.configuration.sharedLib.profile.567812986" name="Device-Profile" parent="com.qnx.qcc.configuration.sharedLib.profile">
<folderInfo id="com.qnx.qcc.configuration.sharedLib.profile.567812986." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.sharedLib.profile.74074582" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<option id="com.qnx.qcc.option.cpu.1546741829" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.367607286" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/CocosDenshion/Device-Profile}" id="com.qnx.nto.786863235" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.846566396" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compiler.shared.657775440" name="Shared (-shared)" superClass="com.qnx.qcc.option.compiler.shared" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compile.debug.104541528" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.profile2.1160378025" name="Build for Profiling (Function Instrumentation) (-finstrument-functions)" superClass="com.qnx.qcc.option.compiler.profile2" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.1414017107" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.2021691363" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.1902073323" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../include"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.2036659301" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.1593319827" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.764681351" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.1599542564" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.1782390923" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.816172034" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.profile2.1767257542" name="Build for Profiling (Function Instrumentation) (-lprofiling)" superClass="com.qnx.qcc.option.linker.profile2" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.shared.2054779718" name="Shared (-shared)" superClass="com.qnx.qcc.option.linker.shared" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.211838712" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.410963030" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.1442577269" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
<inputType id="com.qnx.qcc.inputType.linker.1289154296" superClass="com.qnx.qcc.inputType.linker">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
<additionalInput kind="additionaldependency" paths="$(LIB_DEPS)"/>
</inputType>
</tool>
<tool id="com.qnx.qcc.tool.archiver.1405420787" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="qnx"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.sharedLib.coverage.319080166">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.sharedLib.coverage.319080166" moduleId="org.eclipse.cdt.core.settings" name="Device-Coverage">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/CocosDenshion"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/CocosDenshion/Device-Coverage"/>
<entry flags="RESOLVED" kind="libraryFile" name="CocosDenshion"/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="com.qnx.tools.ide.qde.core.QDELinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="so" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.coverage,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" description="Build with Code Coverage" id="com.qnx.qcc.configuration.sharedLib.coverage.319080166" name="Device-Coverage" parent="com.qnx.qcc.configuration.sharedLib.coverage">
<folderInfo id="com.qnx.qcc.configuration.sharedLib.coverage.319080166." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.sharedLib.coverage.1989429835" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<option id="com.qnx.qcc.option.cpu.1934615589" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1216102857" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/CocosDenshion/Device-Coverage}" id="com.qnx.nto.495097298" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.1484874891" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compiler.shared.681217815" name="Shared (-shared)" superClass="com.qnx.qcc.option.compiler.shared" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compile.debug.757028752" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.coverage.751288313" name="Build for Code Coverage (-Wc,-ftest-coverage -Wc,-fprofile-arcs)" superClass="com.qnx.qcc.option.compiler.coverage" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.1285172306" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.1184848882" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.1623606780" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../include"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.1381169559" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.2042476527" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.969950469" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.1677099579" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.533573966" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.1616435546" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.coverage.609660025" name="Build for Code Coverage (-ftest-coverage -fprofile-arcs -p)" superClass="com.qnx.qcc.option.linker.coverage" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.shared.196470993" name="Shared (-shared)" superClass="com.qnx.qcc.option.linker.shared" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.2037217861" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.1123898612" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.852035655" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
<inputType id="com.qnx.qcc.inputType.linker.1173473664" superClass="com.qnx.qcc.inputType.linker">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
<additionalInput kind="additionaldependency" paths="$(LIB_DEPS)"/>
</inputType>
</tool>
<tool id="com.qnx.qcc.tool.archiver.1264581465" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="qnx"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.sharedLib.debug.1860986297">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.sharedLib.debug.1860986297" moduleId="org.eclipse.cdt.core.settings" name="Simulator">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/CocosDenshion"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/CocosDenshion/Simulator"/>
<entry flags="RESOLVED" kind="libraryFile" name="CocosDenshion"/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="com.qnx.tools.ide.qde.core.QDELinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="so" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" description="" id="com.qnx.qcc.configuration.sharedLib.debug.1860986297" name="Simulator" parent="com.qnx.qcc.configuration.sharedLib.debug">
<folderInfo id="com.qnx.qcc.configuration.sharedLib.debug.1860986297." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.sharedLib.debug.1648614779" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1124540755" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/CocosDenshion/Simulator}" id="com.qnx.nto.839746866" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.1166275781" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compiler.shared.1424968279" name="Shared (-shared)" superClass="com.qnx.qcc.option.compiler.shared" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compile.debug.1515245065" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.1757939921" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.1382867785" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.2095496301" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../include"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.1896937509" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.2927189" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.1451388056" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.1516784639" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.1846742088" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.1351168812" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.shared.223675154" name="Shared (-shared)" superClass="com.qnx.qcc.option.linker.shared" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.1133055581" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.1320742543" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.718721840" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
<inputType id="com.qnx.qcc.inputType.linker.1423728515" superClass="com.qnx.qcc.inputType.linker">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
<additionalInput kind="additionaldependency" paths="$(LIB_DEPS)"/>
</inputType>
</tool>
<tool id="com.qnx.qcc.tool.archiver.1445187255" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="qnx"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.sharedLib.profile.1679221709">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.sharedLib.profile.1679221709" moduleId="org.eclipse.cdt.core.settings" name="Simulator-Profile">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/CocosDenshion"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/CocosDenshion/Simulator-Profile"/>
<entry flags="RESOLVED" kind="libraryFile" name="CocosDenshion"/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="com.qnx.tools.ide.qde.core.QDELinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="so" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.profile,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" description="Build for Profiling" id="com.qnx.qcc.configuration.sharedLib.profile.1679221709" name="Simulator-Profile" parent="com.qnx.qcc.configuration.sharedLib.profile">
<folderInfo id="com.qnx.qcc.configuration.sharedLib.profile.1679221709." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.sharedLib.profile.1010524476" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.631863342" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/CocosDenshion/Simulator-Profile}" id="com.qnx.nto.67816227" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.1400666441" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compiler.shared.1389473150" name="Shared (-shared)" superClass="com.qnx.qcc.option.compiler.shared" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compile.debug.2043094590" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.profile2.1074881151" name="Build for Profiling (Function Instrumentation) (-finstrument-functions)" superClass="com.qnx.qcc.option.compiler.profile2" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.101529550" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.2135233180" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.1642853310" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../include"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.746859765" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.1765504931" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.787794566" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.118609505" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.1767794943" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.1077722668" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.profile2.1956135608" name="Build for Profiling (Function Instrumentation) (-lprofiling)" superClass="com.qnx.qcc.option.linker.profile2" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.shared.1936465025" name="Shared (-shared)" superClass="com.qnx.qcc.option.linker.shared" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.1295689731" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.1333430607" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.1018342959" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
<inputType id="com.qnx.qcc.inputType.linker.1759455963" superClass="com.qnx.qcc.inputType.linker">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
<additionalInput kind="additionaldependency" paths="$(LIB_DEPS)"/>
</inputType>
</tool>
<tool id="com.qnx.qcc.tool.archiver.646048280" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="qnx"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.sharedLib.coverage.675379562">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.sharedLib.coverage.675379562" moduleId="org.eclipse.cdt.core.settings" name="Simulator-Coverage">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/CocosDenshion"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/CocosDenshion/Simulator-Coverage"/>
<entry flags="RESOLVED" kind="libraryFile" name="CocosDenshion"/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="com.qnx.tools.ide.qde.core.QDELinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="so" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.coverage,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" description="Build with Code Coverage" id="com.qnx.qcc.configuration.sharedLib.coverage.675379562" name="Simulator-Coverage" parent="com.qnx.qcc.configuration.sharedLib.coverage">
<folderInfo id="com.qnx.qcc.configuration.sharedLib.coverage.675379562." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.sharedLib.coverage.503745710" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.453394324" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/CocosDenshion/Simulator-Coverage}" id="com.qnx.nto.900424478" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.1653965728" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compiler.shared.1502035671" name="Shared (-shared)" superClass="com.qnx.qcc.option.compiler.shared" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compile.debug.1133385028" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.coverage.1003392028" name="Build for Code Coverage (-Wc,-ftest-coverage -Wc,-fprofile-arcs)" superClass="com.qnx.qcc.option.compiler.coverage" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.994172716" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.1430098685" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.2120251176" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../include"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.1894319763" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.1342605017" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.1988392916" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.623605974" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.557662309" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.2077179537" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.coverage.1300750623" name="Build for Code Coverage (-ftest-coverage -fprofile-arcs -p)" superClass="com.qnx.qcc.option.linker.coverage" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.shared.692015673" name="Shared (-shared)" superClass="com.qnx.qcc.option.linker.shared" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.2076404861" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.1793451941" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.640263912" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
<inputType id="com.qnx.qcc.inputType.linker.1722491721" superClass="com.qnx.qcc.inputType.linker">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
<additionalInput kind="additionaldependency" paths="$(LIB_DEPS)"/>
</inputType>
</tool>
<tool id="com.qnx.qcc.tool.archiver.353050084" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="qnx"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="CocosDenshion.null.848900386" name="CocosDenshion"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.sharedLib.profile.1679221709">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.sharedLib.coverage.319080166">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.sharedLib.debug.1860986297">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.sharedLib.coverage.675379562">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.sharedLib.release.1714403537">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.sharedLib.profile.567812986">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.sharedLib.debug.1659124577">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="refreshScope"/>
<storageModule moduleId="com.qnx.tools.ide.qde.core.QNXProjectProperties"/>
</cproject>

View File

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>CocosDenshion</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
<value>${workspace_loc:/CocosDenshion/Device-Release}</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>com.qnx.tools.ide.bbt.core.bbtnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
</natures>
<linkedResources>
<link>
<name>include</name>
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOC/include</locationURI>
</link>
<link>
<name>qnx</name>
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOC/qnx</locationURI>
</link>
</linkedResources>
</projectDescription>

View File

@ -0,0 +1,528 @@
/****************************************************************************
Copyright (c) 2010 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include <map>
#include <string>
#include <stdio.h>
#include <unistd.h>
#include <AL/al.h>
#include <AL/alc.h>
#include <AL/alut.h>
#include <mm/renderer.h>
#include <sys/stat.h>
//#include "CCFileUtils.h"
#include "SimpleAudioEngine.h"
using namespace std;
namespace CocosDenshion
{
struct soundData {
ALuint buffer;
ALuint source;
bool isLooped;
};
typedef map<string, soundData *> EffectsMap;
EffectsMap s_effects;
typedef enum {
PLAYING,
STOPPED,
PAUSED,
} playStatus;
static int s_audioOid;
static float s_volume = 1.0f;
static float s_effectVolume = 1.0f;
static bool s_isBackgroundInitialized = false;
static bool s_hasMMRError = false;
static playStatus s_playStatus = STOPPED;
static string s_currentBackgroundStr;
static mmr_connection_t *s_mmrConnection = 0;
static mmr_context_t *s_mmrContext = 0;
static strm_dict_t *s_repeatDictionary = 0;
static strm_dict_t *s_volumeDictionary = 0;
static SimpleAudioEngine *s_engine = 0;
static string s_strResourcePath = "./app/native/Resource/";
static void printALError(int err)
{
switch (err)
{
case AL_NO_ERROR:
fprintf(stderr, "AL_NO_ERROR");
break;
case AL_INVALID_NAME:
fprintf(stderr, "AL_INVALID_NAME");
break;
case AL_INVALID_ENUM:
fprintf(stderr, "AL_INVALID_ENUM");
break;
case AL_INVALID_VALUE:
fprintf(stderr, "AL_INVALID_VALUE");
break;
case AL_INVALID_OPERATION:
fprintf(stderr, "AL_INVALID_OPERATION");
break;
case AL_OUT_OF_MEMORY:
fprintf(stderr, "AL_OUT_OF_MEMORY");
break;
};
}
static void mmrerror(mmr_context_t *ctxt, const char *msg)
{
const mmr_error_info_t *err = mmr_error_info( ctxt );
unsigned errcode = (err) ? err->error_code : -1;
const char *name;
fprintf(stderr, "%s: error %d \n", msg, errcode);
s_hasMMRError = true;
}
static void stopBackground(bool bReleaseData)
{
s_playStatus = STOPPED;
if (s_mmrContext)
mmr_stop(s_mmrContext);
if (bReleaseData)
{
if (s_mmrContext)
{
mmr_input_detach(s_mmrContext);
mmr_context_destroy(s_mmrContext);
}
if (s_mmrConnection)
mmr_disconnect(s_mmrConnection);
if (s_repeatDictionary)
strm_dict_destroy(s_repeatDictionary);
if (s_volumeDictionary)
strm_dict_destroy(s_volumeDictionary);
s_mmrContext = 0;
s_mmrConnection = 0;
s_repeatDictionary = 0;
s_volumeDictionary = 0;
s_hasMMRError = false;
s_currentBackgroundStr = "";
s_isBackgroundInitialized = false;
}
}
static void setBackgroundVolume(float volume)
{
if (!s_isBackgroundInitialized)
{
return;
}
char volume_str[128];
// set it up the background volume
strm_dict_t *dictionary = strm_dict_new();
sprintf(volume_str, "%d", (int)(volume * 100) );
s_volumeDictionary = strm_dict_set(dictionary, "volume", volume_str);
if (mmr_output_parameters(s_mmrContext, s_audioOid, s_volumeDictionary) != 0)
{
mmrerror(s_mmrContext, "output parameters");
return;
}
}
SimpleAudioEngine::SimpleAudioEngine()
{
alutInit(0, 0);
}
SimpleAudioEngine::~SimpleAudioEngine()
{
alutExit();
}
SimpleAudioEngine* SimpleAudioEngine::sharedEngine()
{
if (!s_engine)
s_engine = new SimpleAudioEngine();
return s_engine;
}
void SimpleAudioEngine::end()
{
// clear all the sounds
EffectsMap::const_iterator end = s_effects.end();
for (EffectsMap::iterator it = s_effects.begin(); it != end; it++)
{
alSourceStop(it->second->source);
alDeleteBuffers(1, &it->second->buffer);
alDeleteSources(1, &it->second->source);
delete it->second;
}
s_effects.clear();
if (s_isBackgroundInitialized)
{
s_isBackgroundInitialized = false;
}
// and the background too
stopBackground(true);
}
void SimpleAudioEngine::setResource(const char* pszZipFileName)
{
}
//
// background audio (using mmrenderer)
//
void SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath)
{
if (!s_isBackgroundInitialized)
{
const char *mmrname = NULL;
const char *ctxtname = "mmrplayer";
char cwd[PATH_MAX];
mode_t mode = S_IRUSR | S_IXUSR;
getcwd(cwd, PATH_MAX);
string path = "file://";
path += cwd;
path += "/";
// CocosDenshion is an independent module, we should not make the coupling between Cocos2dx and CocosDenshion.
path += s_strResourcePath;//cocos2d::CCFileUtils::getResourcePath();
path += pszFilePath;
s_mmrConnection = mmr_connect(mmrname);
if (!s_mmrConnection)
{
perror("mmr_connect");
s_hasMMRError = true;
return;
}
s_mmrContext = mmr_context_create(s_mmrConnection, ctxtname, 0, mode);
if (!s_mmrContext)
{
perror(ctxtname);
s_hasMMRError = true;
return;
}
if ((s_audioOid = mmr_output_attach(s_mmrContext, "audio:default", "audio")) < 0)
{
mmrerror(s_mmrContext, "audio:default");
return;
}
if (mmr_input_attach(s_mmrContext, path.data(), "autolist") < 0)
{
fprintf(stderr, "unable to load %s\n", path.data());
mmrerror(s_mmrContext, path.data());
return;
}
s_currentBackgroundStr = pszFilePath;
s_isBackgroundInitialized = true;
setBackgroundVolume(s_volume);
}
}
void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop)
{
if (0 != strcmp(s_currentBackgroundStr.c_str(), pszFilePath))
{
stopBackgroundMusic(true);
}
else
{
if (s_playStatus == PAUSED)
resumeBackgroundMusic();
else
rewindBackgroundMusic();
}
if (!s_isBackgroundInitialized)
preloadBackgroundMusic(pszFilePath);
if (bLoop)
{
// set it up to loop
strm_dict_t *dictionary = strm_dict_new();
s_repeatDictionary = strm_dict_set(dictionary, "repeat", "all");
if (mmr_input_parameters(s_mmrContext, s_repeatDictionary) != 0)
{
mmrerror(s_mmrContext, "input parameters (loop)");
return;
}
}
if (s_hasMMRError || !s_mmrContext)
return;
if (mmr_play(s_mmrContext) < 0)
{
mmrerror(s_mmrContext, "mmr_play");
s_hasMMRError = true;
}
if (!s_hasMMRError)
s_playStatus = PLAYING;
}
void SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData)
{
// if we were paused then we need to resume first so that we can play
if (s_playStatus == PAUSED)
resumeBackgroundMusic();
stopBackground(bReleaseData);
}
void SimpleAudioEngine::pauseBackgroundMusic()
{
if (s_mmrContext && mmr_speed_set(s_mmrContext, 0) < 0)
{
mmrerror(s_mmrContext, "pause");
}
s_playStatus = PAUSED;
}
void SimpleAudioEngine::resumeBackgroundMusic()
{
if (s_mmrContext && mmr_speed_set(s_mmrContext, 1000) < 0)
{
mmrerror(s_mmrContext, "resume");
}
s_playStatus = PLAYING;
}
void SimpleAudioEngine::rewindBackgroundMusic()
{
if (s_mmrContext && mmr_seek(s_mmrContext, "1:0") < 0)
{
mmrerror(s_mmrContext, "rewind");
}
}
bool SimpleAudioEngine::willPlayBackgroundMusic()
{
return true;
}
bool SimpleAudioEngine::isBackgroundMusicPlaying()
{
return (s_playStatus == PLAYING) && s_isBackgroundInitialized;
}
float SimpleAudioEngine::getBackgroundMusicVolume()
{
return s_volume;
}
void SimpleAudioEngine::setBackgroundMusicVolume(float volume)
{
if (s_volume != volume && volume >= -0.0001 && volume <= 1.0001)
{
s_volume = volume;
setBackgroundVolume(volume);
}
}
//
// Effect audio (using OpenAL)
//
float SimpleAudioEngine::getEffectsVolume()
{
return s_effectVolume;
}
void SimpleAudioEngine::setEffectsVolume(float volume)
{
if (volume != s_effectVolume)
{
EffectsMap::const_iterator end = s_effects.end();
for (EffectsMap::const_iterator it = s_effects.begin(); it != end; it++)
{
alSourcef(it->second->source, AL_GAIN, volume);
}
s_effectVolume = volume;
}
}
unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop)
{
EffectsMap::iterator iter = s_effects.find(pszFilePath);
if (iter == s_effects.end())
{
preloadEffect(pszFilePath);
// let's try again
iter = s_effects.find(pszFilePath);
if (iter == s_effects.end())
{
fprintf(stderr, "could not find play sound %s\n", pszFilePath);
return -1;
}
}
iter->second->isLooped = bLoop;
alSourcei(iter->second->source, AL_LOOPING, iter->second->isLooped ? AL_TRUE : AL_FALSE);
alSourcePlay(iter->second->source);
return iter->second->source;
}
void SimpleAudioEngine::stopEffect(unsigned int nSoundId)
{
alSourceStop(nSoundId);
}
void SimpleAudioEngine::preloadEffect(const char* pszFilePath)
{
EffectsMap::iterator iter = s_effects.find(pszFilePath);
// check if we have this already
if (iter == s_effects.end())
{
ALuint buffer;
ALuint source;
soundData *data = new soundData;
// CocosDenshion is an independent module, we should not make the coupling between Cocos2dx and CocosDenshion.
string path = s_strResourcePath;// cocos2d::CCFileUtils::getResourcePath();
path += pszFilePath;
buffer = alutCreateBufferFromFile(path.data());
if (buffer == AL_NONE)
{
fprintf(stderr, "Error loading file: '%s'\n", path.data());
alDeleteBuffers(1, &buffer);
return;
}
alGenSources(1, &source);
alSourcei(source, AL_BUFFER, buffer);
data->isLooped = false;
data->buffer = buffer;
data->source = source;
s_effects.insert(EffectsMap::value_type(pszFilePath, data));
}
}
void SimpleAudioEngine::unloadEffect(const char* pszFilePath)
{
EffectsMap::iterator iter = s_effects.find(pszFilePath);
if (iter != s_effects.end())
{
alSourceStop(iter->second->source);
alDeleteSources(1, &iter->second->source);
alDeleteBuffers(1, &iter->second->buffer);
delete iter->second;
int err = alGetError();
if (err != AL_NO_ERROR)
printALError(err);
s_effects.erase(iter);
}
}
void SimpleAudioEngine::pauseEffect(unsigned int nSoundId)
{
alSourcePause(nSoundId);
}
void SimpleAudioEngine::pauseAllEffects()
{
EffectsMap::iterator iter = s_effects.begin();
if (iter != s_effects.end())
{
alSourcePause(iter->second->source);
int err = alGetError();
if (err != AL_NO_ERROR)
printALError(err);
}
}
void SimpleAudioEngine::resumeEffect(unsigned int nSoundId)
{
alSourcePlay(nSoundId);
}
void SimpleAudioEngine::resumeAllEffects()
{
EffectsMap::iterator iter = s_effects.begin();
if (iter != s_effects.end())
{
alSourcePlay(iter->second->source);
int err = alGetError();
if (err != AL_NO_ERROR)
printALError(err);
}
}
void SimpleAudioEngine::stopAllEffects()
{
EffectsMap::iterator iter = s_effects.begin();
if (iter != s_effects.end())
{
alSourceStop(iter->second->source);
int err = alGetError();
if (err != AL_NO_ERROR)
printALError(err);
}
}
}

View File

@ -79,6 +79,11 @@ bool AppDelegate::initInstance() {
#endif // CC_PLATFORM_BADA
#if (CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
CCEGLView * pMainWnd = new CCEGLView();
CC_BREAK_IF(! pMainWnd|| ! pMainWnd->Create(480, 320));
CCFileUtils::setResourcePath("./app/native/Resource");
#endif // CC_PLATFORM_QNX
bRet = true;
} while (0);
return bRet;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<bada>
<type>0</type>
<sdk>C:\bada\1.0.0</sdk>
<sdk>E:\bada\1.0.0</sdk>
<model>Wave_LP2</model>
<properties/>
</bada>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<bada>
<type>0</type>
<sdk>e:\bada\2.0.2</sdk>
<sdk>E:\bada\2.0.2</sdk>
<model>WaveWVGA</model>
<apiversioncheck>true</apiversioncheck>
<priviligecheck>false</priviligecheck>

553
HelloWorld/qnx/.cproject Normal file
View File

@ -0,0 +1,553 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.qnx.qcc.configuration.exe.debug.446234419">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.exe.debug.446234419" moduleId="org.eclipse.cdt.core.settings" name="Device-Debug">
<externalSettings/>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="com.qnx.tools.ide.qde.core.QDELinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" description="" id="com.qnx.qcc.configuration.exe.debug.446234419" name="Device-Debug" parent="com.qnx.qcc.configuration.exe.debug">
<folderInfo id="com.qnx.qcc.configuration.exe.debug.446234419." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.exe.debug.2114985022" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<option id="com.qnx.qcc.option.cpu.476871357" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.243174525" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/HelloWorld/Device-Debug}" id="com.qnx.nto.476715223" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.1144576773" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.477981148" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.950802078" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.947876049" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.892081154" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../Classes"/>
<listOptionValue builtIn="false" value="../../../"/>
<listOptionValue builtIn="false" value="../../../cocos2dx"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/include"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/qnx"/>
<listOptionValue builtIn="false" value="../../../chipmunk/include/chipmunk"/>
<listOptionValue builtIn="false" value="../../../CocosDenshion/include"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.1174705489" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.298372204" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.1245805836" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.954888053" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.1869091739" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.2017324338" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.670245200" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraries.1760958269" name="Libraries (-l)" superClass="com.qnx.qcc.option.linker.libraries" valueType="libs">
<listOptionValue builtIn="false" value="cocos2dx"/>
<listOptionValue builtIn="false" value="bps"/>
<listOptionValue builtIn="false" value="grskia"/>
</option>
<option id="com.qnx.qcc.option.linker.security.1794064552" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.1757627798" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/proj.qnx/Device-Debug"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/qnx/libraries"/>
</option>
<inputType id="com.qnx.qcc.inputType.linker.697035559" superClass="com.qnx.qcc.inputType.linker">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
<additionalInput kind="additionaldependency" paths="$(LIB_DEPS)"/>
</inputType>
</tool>
<tool id="com.qnx.qcc.tool.archiver.301444246" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Classes"/>
<entry excluding="Classes" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.exe.release.1265921422">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.exe.release.1265921422" moduleId="org.eclipse.cdt.core.settings" name="Device-Release">
<externalSettings/>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="com.qnx.tools.ide.qde.core.QDELinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" description="" id="com.qnx.qcc.configuration.exe.release.1265921422" name="Device-Release" parent="com.qnx.qcc.configuration.exe.release">
<folderInfo id="com.qnx.qcc.configuration.exe.release.1265921422." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.exe.release.4046903" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<option id="com.qnx.qcc.option.cpu.49495308" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.2115941098" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/HelloWorld/Device-Release}" id="com.qnx.nto.1079130834" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.489158604" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compiler.optlevel.1816856148" name="Optimization Level" superClass="com.qnx.qcc.option.compiler.optlevel" value="com.qnx.qcc.option.compiler.optlevel.2" valueType="enumerated"/>
<option id="com.qnx.qcc.option.compiler.security.516815496" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.1389762293" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.pie.456946828" name="Position Independent Executable (-fPIE)" superClass="com.qnx.qcc.option.compiler.pie" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.includePath.1777714844" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../Classes"/>
<listOptionValue builtIn="false" value="../../../"/>
<listOptionValue builtIn="false" value="../../../cocos2dx"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/include"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/qnx"/>
<listOptionValue builtIn="false" value="../../../chipmunk/include/chipmunk"/>
<listOptionValue builtIn="false" value="../../../CocosDenshion/include"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.1481914218" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.1981472408" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<inputType id="com.qnx.qcc.inputType.assembler.1358975089" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.1460295121" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.langcpp.1928031496" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraries.1701813567" name="Libraries (-l)" superClass="com.qnx.qcc.option.linker.libraries" valueType="libs">
<listOptionValue builtIn="false" value="cocos2dx"/>
<listOptionValue builtIn="false" value="bps"/>
<listOptionValue builtIn="false" value="grskia"/>
</option>
<option id="com.qnx.qcc.option.linker.security.1061945690" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.pie.2077677263" name="Position Independent Executable (-pie)" superClass="com.qnx.qcc.option.linker.pie" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.1491934160" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/proj.qnx/Device-Release"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/qnx/libraries"/>
</option>
<inputType id="com.qnx.qcc.inputType.linker.1321710093" superClass="com.qnx.qcc.inputType.linker">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
<additionalInput kind="additionaldependency" paths="$(LIB_DEPS)"/>
</inputType>
</tool>
<tool id="com.qnx.qcc.tool.archiver.1156203201" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Classes"/>
<entry excluding="Classes" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.exe.profile.1761000041">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.exe.profile.1761000041" moduleId="org.eclipse.cdt.core.settings" name="Device-Profile">
<externalSettings/>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="com.qnx.tools.ide.qde.core.QDELinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.profile,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" description="Build for Profiling" id="com.qnx.qcc.configuration.exe.profile.1761000041" name="Device-Profile" parent="com.qnx.qcc.configuration.exe.profile">
<folderInfo id="com.qnx.qcc.configuration.exe.profile.1761000041." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.exe.profile.1124526836" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<option id="com.qnx.qcc.option.cpu.463099906" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.2119914966" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/HelloWorld/Device-Profile}" id="com.qnx.nto.375294946" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.1156975065" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.516699842" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.profile2.827918638" name="Build for Profiling (Function Instrumentation) (-finstrument-functions)" superClass="com.qnx.qcc.option.compiler.profile2" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.90830663" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.2011249500" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.2118671865" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../Classes"/>
<listOptionValue builtIn="false" value="../../../"/>
<listOptionValue builtIn="false" value="../../../cocos2dx"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/include"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/qnx"/>
<listOptionValue builtIn="false" value="../../../chipmunk/include/chipmunk"/>
<listOptionValue builtIn="false" value="../../../CocosDenshion/include"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.949042507" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.204612102" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.1402394581" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.51504326" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.757736298" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.2002086963" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.profile2.1064338465" name="Build for Profiling (Function Instrumentation) (-lprofiling)" superClass="com.qnx.qcc.option.linker.profile2" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.1232550377" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraries.1289108024" name="Libraries (-l)" superClass="com.qnx.qcc.option.linker.libraries" valueType="libs">
<listOptionValue builtIn="false" value="cocos2dx"/>
<listOptionValue builtIn="false" value="bps"/>
<listOptionValue builtIn="false" value="grskia"/>
</option>
<option id="com.qnx.qcc.option.linker.security.29518400" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.150600101" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/proj.qnx/Device-Profile"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/qnx/libraries"/>
</option>
<inputType id="com.qnx.qcc.inputType.linker.1078171597" superClass="com.qnx.qcc.inputType.linker">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
<additionalInput kind="additionaldependency" paths="$(LIB_DEPS)"/>
</inputType>
</tool>
<tool id="com.qnx.qcc.tool.archiver.1781241255" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Classes"/>
<entry excluding="Classes" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.exe.profile.coverage.1771167181">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.exe.profile.coverage.1771167181" moduleId="org.eclipse.cdt.core.settings" name="Device-Coverage">
<externalSettings/>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="com.qnx.tools.ide.qde.core.QDELinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.coverage,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" description="Build for Code Coverage" id="com.qnx.qcc.configuration.exe.profile.coverage.1771167181" name="Device-Coverage" parent="com.qnx.qcc.configuration.exe.profile.coverage">
<folderInfo id="com.qnx.qcc.configuration.exe.profile.coverage.1771167181." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.exe.coverage.1048447960" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<option id="com.qnx.qcc.option.cpu.1184616968" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.617597973" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/HelloWorld/Device-Coverage}" id="com.qnx.nto.168144620" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.1214860716" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.1865580810" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.coverage.417773989" name="Build for Code Coverage (-Wc,-ftest-coverage -Wc,-fprofile-arcs)" superClass="com.qnx.qcc.option.compiler.coverage" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.2078595424" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.2117581868" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.1766273669" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../Classes"/>
<listOptionValue builtIn="false" value="../../../"/>
<listOptionValue builtIn="false" value="../../../cocos2dx"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/include"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/qnx"/>
<listOptionValue builtIn="false" value="../../../chipmunk/include/chipmunk"/>
<listOptionValue builtIn="false" value="../../../CocosDenshion/include"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.901688047" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.1913823743" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.585829451" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.652294347" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.1367226426" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.1276383563" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.coverage.390406687" name="Build for Code Coverage (-ftest-coverage -fprofile-arcs -p)" superClass="com.qnx.qcc.option.linker.coverage" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.1160718760" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraries.1736864271" name="Libraries (-l)" superClass="com.qnx.qcc.option.linker.libraries" valueType="libs">
<listOptionValue builtIn="false" value="cocos2dx"/>
<listOptionValue builtIn="false" value="bps"/>
<listOptionValue builtIn="false" value="grskia"/>
</option>
<option id="com.qnx.qcc.option.linker.security.1670627205" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.322375874" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/proj.qnx/Device-Coverage"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/qnx/libraries"/>
</option>
<inputType id="com.qnx.qcc.inputType.linker.1438498440" superClass="com.qnx.qcc.inputType.linker">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
<additionalInput kind="additionaldependency" paths="$(LIB_DEPS)"/>
</inputType>
</tool>
<tool id="com.qnx.qcc.tool.archiver.30542244" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Classes"/>
<entry excluding="Classes" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.exe.debug.660208940">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.exe.debug.660208940" moduleId="org.eclipse.cdt.core.settings" name="Simulator">
<externalSettings/>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="com.qnx.tools.ide.qde.core.QDELinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" description="" id="com.qnx.qcc.configuration.exe.debug.660208940" name="Simulator" parent="com.qnx.qcc.configuration.exe.debug">
<folderInfo id="com.qnx.qcc.configuration.exe.debug.660208940." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.exe.debug.268891510" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.240715499" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/HelloWorld/Simulator}" id="com.qnx.nto.1270333356" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.431759757" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.2024008205" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.2119227735" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.250718869" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.1838736665" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../Classes"/>
<listOptionValue builtIn="false" value="../../../"/>
<listOptionValue builtIn="false" value="../../../cocos2dx"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/include"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/qnx"/>
<listOptionValue builtIn="false" value="../../../chipmunk/include/chipmunk"/>
<listOptionValue builtIn="false" value="../../../CocosDenshion/include"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.1997773972" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.1469514654" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.1201110421" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.971190882" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.1378371763" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.1155728719" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.550638471" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraries.1179286572" name="Libraries (-l)" superClass="com.qnx.qcc.option.linker.libraries" valueType="libs">
<listOptionValue builtIn="false" value="cocos2dx"/>
<listOptionValue builtIn="false" value="bps"/>
<listOptionValue builtIn="false" value="grskia"/>
</option>
<option id="com.qnx.qcc.option.linker.security.2014666509" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.927694704" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/proj.qnx/Simulator"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/qnx/libraries/x86"/>
</option>
<option id="com.qnx.qcc.option.linker.objectFiles.1451516298" name="Additional Object Files" superClass="com.qnx.qcc.option.linker.objectFiles"/>
<inputType id="com.qnx.qcc.inputType.linker.439307041" superClass="com.qnx.qcc.inputType.linker">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
<additionalInput kind="additionaldependency" paths="$(LIB_DEPS)"/>
</inputType>
</tool>
<tool id="com.qnx.qcc.tool.archiver.1720091399" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Classes"/>
<entry excluding="Classes" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.exe.profile.1237484173">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.exe.profile.1237484173" moduleId="org.eclipse.cdt.core.settings" name="Simulator-Profile">
<externalSettings/>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="com.qnx.tools.ide.qde.core.QDELinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.profile,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" description="Build for Profiling" id="com.qnx.qcc.configuration.exe.profile.1237484173" name="Simulator-Profile" parent="com.qnx.qcc.configuration.exe.profile">
<folderInfo id="com.qnx.qcc.configuration.exe.profile.1237484173." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.exe.profile.895301801" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.191826099" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/HelloWorld/Simulator-Profile}" id="com.qnx.nto.47902617" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.1309978635" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.347183646" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.profile2.53874439" name="Build for Profiling (Function Instrumentation) (-finstrument-functions)" superClass="com.qnx.qcc.option.compiler.profile2" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.728843003" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.307652248" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.1315014042" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../Classes"/>
<listOptionValue builtIn="false" value="../../../"/>
<listOptionValue builtIn="false" value="../../../cocos2dx"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/include"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/qnx"/>
<listOptionValue builtIn="false" value="../../../chipmunk/include/chipmunk"/>
<listOptionValue builtIn="false" value="../../../CocosDenshion/include"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.1682829736" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.807410238" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.1290612958" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.1525407149" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.680182007" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.925450350" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.profile2.1569002848" name="Build for Profiling (Function Instrumentation) (-lprofiling)" superClass="com.qnx.qcc.option.linker.profile2" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.1840561937" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraries.1031790004" name="Libraries (-l)" superClass="com.qnx.qcc.option.linker.libraries" valueType="libs">
<listOptionValue builtIn="false" value="cocos2dx"/>
<listOptionValue builtIn="false" value="bps"/>
<listOptionValue builtIn="false" value="grskia"/>
</option>
<option id="com.qnx.qcc.option.linker.security.931994389" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.681434121" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/proj.qnx/Simulator-Profile"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/qnx/libraries/x86"/>
</option>
<inputType id="com.qnx.qcc.inputType.linker.2044213175" superClass="com.qnx.qcc.inputType.linker">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
<additionalInput kind="additionaldependency" paths="$(LIB_DEPS)"/>
</inputType>
</tool>
<tool id="com.qnx.qcc.tool.archiver.924511539" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Classes"/>
<entry excluding="Classes" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.exe.profile.coverage.181538713">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.exe.profile.coverage.181538713" moduleId="org.eclipse.cdt.core.settings" name="Simulator-Coverage">
<externalSettings/>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="com.qnx.tools.ide.qde.core.QDELinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.coverage,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" description="Build for Code Coverage" id="com.qnx.qcc.configuration.exe.profile.coverage.181538713" name="Simulator-Coverage" parent="com.qnx.qcc.configuration.exe.profile.coverage">
<folderInfo id="com.qnx.qcc.configuration.exe.profile.coverage.181538713." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.exe.coverage.2030436518" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.538034305" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/HelloWorld/Simulator-Coverage}" id="com.qnx.nto.411824448" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.1856118712" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.367463903" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.coverage.2144541749" name="Build for Code Coverage (-Wc,-ftest-coverage -Wc,-fprofile-arcs)" superClass="com.qnx.qcc.option.compiler.coverage" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.2041278353" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.1008023515" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.1142643875" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../Classes"/>
<listOptionValue builtIn="false" value="../../../"/>
<listOptionValue builtIn="false" value="../../../cocos2dx"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/include"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/qnx"/>
<listOptionValue builtIn="false" value="../../../chipmunk/include/chipmunk"/>
<listOptionValue builtIn="false" value="../../../CocosDenshion/include"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.616747785" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.1686811724" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.2086702984" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.111630752" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.35285082" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.1514682747" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.coverage.1881413807" name="Build for Code Coverage (-ftest-coverage -fprofile-arcs -p)" superClass="com.qnx.qcc.option.linker.coverage" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.769428310" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraries.1325336223" name="Libraries (-l)" superClass="com.qnx.qcc.option.linker.libraries" valueType="libs">
<listOptionValue builtIn="false" value="cocos2dx"/>
<listOptionValue builtIn="false" value="bps"/>
<listOptionValue builtIn="false" value="grskia"/>
</option>
<option id="com.qnx.qcc.option.linker.security.2136296969" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.1115848281" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/proj.qnx/Simulator-Coverage"/>
<listOptionValue builtIn="false" value="../../../cocos2dx/platform/third_party/qnx/libraries/x86"/>
</option>
<inputType id="com.qnx.qcc.inputType.linker.780133405" superClass="com.qnx.qcc.inputType.linker">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
<additionalInput kind="additionaldependency" paths="$(LIB_DEPS)"/>
</inputType>
</tool>
<tool id="com.qnx.qcc.tool.archiver.2108749298" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="Classes"/>
<entry excluding="Classes" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="HelloWorld.null.1273913276" name="HelloWorld"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.exe.debug.660208940">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.exe.profile.1237484173">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.exe.release.1265921422">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.exe.profile.coverage.181538713">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.exe.profile.1761000041">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.exe.debug.446234419">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.exe.profile.coverage.1771167181">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="com.qnx.tools.ide.qde.core.QNXProjectProperties"/>
<storageModule moduleId="refreshScope"/>
</cproject>

89
HelloWorld/qnx/.project Normal file
View File

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>HelloWorld</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
<value>${workspace_loc:/HelloWorld/Device-Release}</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>com.qnx.tools.ide.bbt.core.bbtnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
</natures>
<linkedResources>
<link>
<name>Classes</name>
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOC/Classes</locationURI>
</link>
<link>
<name>Resource</name>
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOC/Resource</locationURI>
</link>
</linkedResources>
</projectDescription>

View File

@ -0,0 +1,121 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
<!-- BlackBerry Tablet OS application descriptor file.
Specifies parameters for identifying, installing, and launching native applications on BlackBerry Tablet OS.
-->
<!-- A universally unique application identifier. Must be unique across all BlackBerry Tablet OS applications.
Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
<id>com.example.HelloWorld</id>
<!-- The name that is displayed in the BlackBerry Tablet OS application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<name>HelloWorld</name>
<!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
An updated version of application must have a versionNumber value higher than the previous version. Required. -->
<versionNumber>1.0.0</versionNumber>
<!-- Fourth digit segment of the package version. First three segments are taken from the
<versionNumber> element. Must be an integer from 0 to 2^16-1 -->
<buildId>1</buildId>
<!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
<!-- <versionLabel></versionLabel> -->
<!-- Description, displayed in the BlackBerry Tablet OS application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<description>The HelloWorld application</description>
<!-- Copyright information. Optional. -->
<!-- <copyright></copyright> -->
<!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
<author>Example Inc.</author>
<icon>
<image>icon.png</image>
</icon>
<!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
<!-- <authorId>ABC1234YjsnUk235h</authorId> -->
<initialWindow>
<systemChrome>none</systemChrome>
<transparent>false</transparent>
</initialWindow>
<!-- The category where the application appears. Either core.games or core.media. -->
<category>core.games</category>
<asset path="icon.png">icon.png</asset>
<asset path="${workspace_loc:/HelloWorld/Resource}">Resource</asset>
<asset path="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib/libbps.so" type="Qnx/Elf">lib/libbps.so.1</asset>
<configuration id="com.qnx.qcc.configuration.exe.debug.446234419" name="Device-Debug">
<platformArchitecture>armle-v7</platformArchitecture>
<asset path="Device-Debug/HelloWorld" entry="true" type="Qnx/Elf">HelloWorld</asset>
<asset path="${workspace_loc:/cocos2dx/Device-Debug/libcocos2dx.so}" type="Qnx/Elf">lib/libcocos2dx.so</asset>
<asset path="${workspace_loc:/cocos2dx/platform/third_party/qnx/libraries/libgrskia.so}" type="Qnx/Elf">lib/libgrskia.so</asset>
</configuration>
<configuration id="com.qnx.qcc.configuration.exe.release.1265921422" name="Device-Release">
<platformArchitecture>armle-v7</platformArchitecture>
<asset path="Device-Release/HelloWorld" entry="true" type="Qnx/Elf">HelloWorld</asset>
<asset path="${workspace_loc:/cocos2dx/platform/third_party/qnx/libraries/libgrskia.so}" type="Qnx/Elf">lib/libgrskia.so</asset>
<asset path="${workspace_loc:/cocos2dx/Device-Release/libcocos2dx.so}" type="Qnx/Elf">lib/libcocos2dx.so</asset>
</configuration>
<configuration id="com.qnx.qcc.configuration.exe.profile.1761000041" name="Device-Profile">
<platformArchitecture>armle-v7</platformArchitecture>
<asset path="Device-Profile/HelloWorld" entry="true" type="Qnx/Elf">HelloWorld</asset>
<asset path="${workspace_loc:/cocos2dx/platform/third_party/qnx/libraries/libgrskia.so}" type="Qnx/Elf">lib/libgrskia.so</asset>
<asset path="${workspace_loc:/cocos2dx/Device-Profile/libcocos2dx.so}" type="Qnx/Elf">lib/libcocos2dx.so</asset>
</configuration>
<configuration id="com.qnx.qcc.configuration.exe.profile.coverage.1771167181" name="Device-Coverage">
<platformArchitecture>armle-v7</platformArchitecture>
<asset path="Device-Coverage/HelloWorld" entry="true" type="Qnx/Elf">HelloWorld</asset>
<asset path="${workspace_loc:/cocos2dx/platform/third_party/qnx/libraries/libgrskia.so}" type="Qnx/Elf">lib/libgrskia.so</asset>
<asset path="${workspace_loc:/cocos2dx/Device-Coverage/libcocos2dx.so}" type="Qnx/Elf">lib/libcocos2dx.so</asset>
</configuration>
<configuration id="com.qnx.qcc.configuration.exe.debug.660208940" name="Simulator">
<platformArchitecture>x86</platformArchitecture>
<asset path="Simulator/HelloWorld" entry="true" type="Qnx/Elf">HelloWorld</asset>
<asset path="${workspace_loc:/cocos2dx/Simulator/libcocos2dx.so}" type="Qnx/Elf">lib/libcocos2dx.so</asset>
<asset path="${workspace_loc:/cocos2dx/platform/third_party/qnx/libraries/x86/libgrskia.so}" type="Qnx/Elf">lib/libgrskia.so</asset>
</configuration>
<configuration id="com.qnx.qcc.configuration.exe.profile.1237484173" name="Simulator-Profile">
<platformArchitecture>x86</platformArchitecture>
<asset path="Simulator-Profile/HelloWorld" entry="true" type="Qnx/Elf">HelloWorld</asset>
<asset path="${workspace_loc:/cocos2dx/platform/third_party/qnx/libraries/x86/libgrskia.so}" type="Qnx/Elf">lib/libgrskia.so</asset>
<asset path="${workspace_loc:/cocos2dx/Simulator-Profile/libcocos2dx.so}" type="Qnx/Elf">lib/libcocos2dx.so</asset>
</configuration>
<configuration id="com.qnx.qcc.configuration.exe.profile.coverage.181538713" name="Simulator-Coverage">
<platformArchitecture>x86</platformArchitecture>
<asset path="Simulator-Coverage/HelloWorld" entry="true" type="Qnx/Elf">HelloWorld</asset>
<asset path="${workspace_loc:/cocos2dx/platform/third_party/qnx/libraries/x86/libgrskia.so}" type="Qnx/Elf">lib/libgrskia.so</asset>
<asset path="${workspace_loc:/cocos2dx/Simulator-Coverage/libcocos2dx.so}" type="Qnx/Elf">lib/libcocos2dx.so</asset>
</configuration>
<!-- The icon for the application, which should be 86x86. -->
<!-- The splash screen that will appear when your application is launching. Should be 1024x600. -->
<!-- <splashscreen></splashscreen> -->
<!-- Request permission to execute native code. Required for native applications. -->
<action system="true">run_native</action>
<!-- The permissions requested by your application. -->
<!-- <action>access_shared</action> -->
<!-- <action>record_audio</action> -->
<!-- <action>read_geolocation</action> -->
<!-- <action>use_camera</action> -->
<!-- <action>access_internet</action> -->
<!-- <action>play_audio</action> -->
<!-- <action>post_notification</action> -->
<!-- <action>set_audio_volume</action> -->
<!-- <action>read_device_identifying_information</action> -->
<!-- Ensure that shared libraries in the package are found at run-time. -->
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
</qnx>

16
HelloWorld/qnx/main.cpp Normal file
View File

@ -0,0 +1,16 @@
#include "cocos2d.h"
#include "AppDelegate.h"
USING_NS_CC;
int main(int argc, char **argv)
{
AppDelegate* app;
int ret = 0;
app = new AppDelegate();
ret = cocos2d::CCApplication::sharedApplication().run();
delete app;
return ret;
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<bada>
<type>0</type>
<sdk>C:\bada\1.0.0</sdk>
<sdk>E:\bada\1.0.0</sdk>
<model>Wave_LP2</model>
<properties/>
</bada>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<bada>
<type>0</type>
<sdk>e:\bada\2.0.2</sdk>
<sdk>E:\bada\2.0.2</sdk>
<model>WaveWVGA</model>
<apiversioncheck>true</apiversioncheck>
<priviligecheck>false</priviligecheck>

421
chipmunk/proj.qnx/.cproject Normal file
View File

@ -0,0 +1,421 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.qnx.qcc.configuration.staticLib.debug.1616529407">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.debug.1616529407" moduleId="org.eclipse.cdt.core.settings" name="Device-Debug">
<externalSettings/>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.debug.1616529407" name="Device-Debug" parent="com.qnx.qcc.configuration.staticLib.debug">
<folderInfo id="com.qnx.qcc.configuration.staticLib.debug.1616529407." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.staticLib.debug.674857678" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<option id="com.qnx.qcc.option.cpu.334372557" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1420510926" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/chipmunk/Device-Debug}" id="com.qnx.nto.790169825" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.2015208707" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.1073145982" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.1172251704" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.726928771" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.839781469" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../include/chipmunk/"/>
</option>
<option id="com.qnx.qcc.option.compiler.ccoptions.416344414" name="Compiler Options (-Wc,)" superClass="com.qnx.qcc.option.compiler.ccoptions" valueType="stringList">
<listOptionValue builtIn="false" value="-std=c99"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.2019030291" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.908868594" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.686329996" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.202479896" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.480505358" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.1658793193" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.1721309860" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.312821842" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.1540210046" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
</tool>
<tool id="com.qnx.qcc.tool.archiver.963276560" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.staticLib.release.1074854256">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.release.1074854256" moduleId="org.eclipse.cdt.core.settings" name="Device-Release">
<externalSettings/>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.release.1074854256" name="Device-Release" parent="com.qnx.qcc.configuration.staticLib.release">
<folderInfo id="com.qnx.qcc.configuration.staticLib.release.1074854256." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.staticLib.release.1955395233" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<option id="com.qnx.qcc.option.cpu.416867299" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1648512112" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/chipmunk/Device-Release}" id="com.qnx.nto.335369697" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.2108489999" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compiler.optlevel.1215729712" name="Optimization Level" superClass="com.qnx.qcc.option.compiler.optlevel" value="com.qnx.qcc.option.compiler.optlevel.2" valueType="enumerated"/>
<option id="com.qnx.qcc.option.compiler.security.1316447034" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.713018398" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.pie.78729760" name="Position Independent Executable (-fPIE)" superClass="com.qnx.qcc.option.compiler.pie" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.includePath.1413823449" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../include/chipmunk/"/>
</option>
<option id="com.qnx.qcc.option.compiler.ccoptions.182296748" name="Compiler Options (-Wc,)" superClass="com.qnx.qcc.option.compiler.ccoptions" valueType="stringList">
<listOptionValue builtIn="false" value="-std=c99"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.541626312" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.791662823" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<inputType id="com.qnx.qcc.inputType.assembler.782694993" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.1349562523" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.langcpp.1186720924" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.674801107" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.pie.873692336" name="Position Independent Executable (-pie)" superClass="com.qnx.qcc.option.linker.pie" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.2015701344" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
</tool>
<tool id="com.qnx.qcc.tool.archiver.2086765264" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.staticLib.profile.213348384">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.profile.213348384" moduleId="org.eclipse.cdt.core.settings" name="Device-Profile">
<externalSettings/>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.profile,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build for Profiling" id="com.qnx.qcc.configuration.staticLib.profile.213348384" name="Device-Profile" parent="com.qnx.qcc.configuration.staticLib.profile">
<folderInfo id="com.qnx.qcc.configuration.staticLib.profile.213348384." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.staticLib.profile.131994281" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<option id="com.qnx.qcc.option.cpu.824148891" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.134226596" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/chipmunk/Device-Profile}" id="com.qnx.nto.738397374" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.2019795858" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.33006691" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.profile2.1478507026" name="Build for Profiling (Function Instrumentation) (-finstrument-functions)" superClass="com.qnx.qcc.option.compiler.profile2" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.231139245" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.382524008" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.457752393" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../include/chipmunk/"/>
</option>
<option id="com.qnx.qcc.option.compiler.ccoptions.1319095965" name="Compiler Options (-Wc,)" superClass="com.qnx.qcc.option.compiler.ccoptions" valueType="stringList">
<listOptionValue builtIn="false" value="-std=c99"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.1468665397" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.768387719" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.557138274" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.1447093895" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.1481294214" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.938016756" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.profile2.965173746" name="Build for Profiling (Function Instrumentation) (-lprofiling)" superClass="com.qnx.qcc.option.linker.profile2" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.149115437" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.1376458225" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.68839537" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
</tool>
<tool id="com.qnx.qcc.tool.archiver.1317555830" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.staticLib.coverage.1076645199">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.coverage.1076645199" moduleId="org.eclipse.cdt.core.settings" name="Device-Coverage">
<externalSettings/>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.coverage,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build with Code Coverage" id="com.qnx.qcc.configuration.staticLib.coverage.1076645199" name="Device-Coverage" parent="com.qnx.qcc.configuration.staticLib.coverage">
<folderInfo id="com.qnx.qcc.configuration.staticLib.coverage.1076645199." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.staticLib.coverage.1859447285" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<option id="com.qnx.qcc.option.cpu.841086347" name="Target CPU:" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.681481370" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/chipmunk/Device-Coverage}" id="com.qnx.nto.765550916" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.420590946" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.2159009" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.coverage.70969128" name="Build for Code Coverage (-Wc,-ftest-coverage -Wc,-fprofile-arcs)" superClass="com.qnx.qcc.option.compiler.coverage" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.1484426115" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.145100704" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.1964928480" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../include/chipmunk/"/>
</option>
<option id="com.qnx.qcc.option.compiler.ccoptions.1197791714" name="Compiler Options (-Wc,)" superClass="com.qnx.qcc.option.compiler.ccoptions" valueType="stringList">
<listOptionValue builtIn="false" value="-std=c99"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.1050246422" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.1129176693" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.2113235922" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.173262557" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.760693085" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.1550099691" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.coverage.709155373" name="Build for Code Coverage (-ftest-coverage -fprofile-arcs -p)" superClass="com.qnx.qcc.option.linker.coverage" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.2140044098" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.2063282729" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.691711369" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
</tool>
<tool id="com.qnx.qcc.tool.archiver.1445541276" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.staticLib.debug.1289808599">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.debug.1289808599" moduleId="org.eclipse.cdt.core.settings" name="Simulator">
<externalSettings/>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.debug.1289808599" name="Simulator" parent="com.qnx.qcc.configuration.staticLib.debug">
<folderInfo id="com.qnx.qcc.configuration.staticLib.debug.1289808599." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.staticLib.debug.462458165" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.838033824" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/chipmunk/Simulator}" id="com.qnx.nto.554915092" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.1815998393" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.276543693" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.914611314" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.641083708" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.521973978" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../include/chipmunk/"/>
</option>
<option id="com.qnx.qcc.option.compiler.ccoptions.1025159120" name="Compiler Options (-Wc,)" superClass="com.qnx.qcc.option.compiler.ccoptions" valueType="stringList">
<listOptionValue builtIn="false" value="-std=c99"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.1902590451" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.927309218" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.233065807" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.1976572676" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.1157363204" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.84243376" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.1666429163" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.883839319" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.512694817" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
</tool>
<tool id="com.qnx.qcc.tool.archiver.63845448" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.staticLib.profile.1140302231">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.profile.1140302231" moduleId="org.eclipse.cdt.core.settings" name="Simulator-Profile">
<externalSettings/>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.profile,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build for Profiling" id="com.qnx.qcc.configuration.staticLib.profile.1140302231" name="Simulator-Profile" parent="com.qnx.qcc.configuration.staticLib.profile">
<folderInfo id="com.qnx.qcc.configuration.staticLib.profile.1140302231." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.staticLib.profile.1836163577" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1277340931" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/chipmunk/Simulator-Profile}" id="com.qnx.nto.612589821" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.2123060390" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.437266444" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.profile2.745436841" name="Build for Profiling (Function Instrumentation) (-finstrument-functions)" superClass="com.qnx.qcc.option.compiler.profile2" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.606175389" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.698647246" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.567560220" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../include/chipmunk/"/>
</option>
<option id="com.qnx.qcc.option.compiler.ccoptions.54752735" name="Compiler Options (-Wc,)" superClass="com.qnx.qcc.option.compiler.ccoptions" valueType="stringList">
<listOptionValue builtIn="false" value="-std=c99"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.1266914626" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.791018221" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.2053534554" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.239661922" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.810357651" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.1969687691" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.profile2.166765834" name="Build for Profiling (Function Instrumentation) (-lprofiling)" superClass="com.qnx.qcc.option.linker.profile2" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.272962286" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.1549792735" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.1554141203" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
</tool>
<tool id="com.qnx.qcc.tool.archiver.254571131" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.qnx.qcc.configuration.staticLib.coverage.1505898052">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.coverage.1505898052" moduleId="org.eclipse.cdt.core.settings" name="Simulator-Coverage">
<externalSettings/>
<extensions>
<extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.coverage,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build with Code Coverage" id="com.qnx.qcc.configuration.staticLib.coverage.1505898052" name="Simulator-Coverage" parent="com.qnx.qcc.configuration.staticLib.coverage">
<folderInfo id="com.qnx.qcc.configuration.staticLib.coverage.1505898052." name="/" resourcePath="">
<toolChain id="com.qnx.qcc.toolChain.staticLib.coverage.366628586" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
<targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1225347575" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
<builder buildPath="${workspace_loc:/chipmunk/Simulator-Coverage}" id="com.qnx.nto.162117226" keepEnvironmentInBuildfile="false" name="CDT Internal Builder" superClass="com.qnx.nto"/>
<tool id="com.qnx.qcc.tool.compiler.1166991280" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
<option id="com.qnx.qcc.option.compile.debug.440607623" name="Debug (-g)" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.coverage.1949688106" name="Build for Code Coverage (-Wc,-ftest-coverage -Wc,-fprofile-arcs)" superClass="com.qnx.qcc.option.compiler.coverage" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.security.1965004546" name="Enhanced Security (-fstack-protector-all)" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.compiler.defines.660061720" name="Defines (-D)" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
<listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
</option>
<option id="com.qnx.qcc.option.compiler.includePath.895872756" name="Include Directories (-I)" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
<listOptionValue builtIn="false" value="../../include/chipmunk/"/>
</option>
<option id="com.qnx.qcc.option.compiler.ccoptions.51249600" name="Compiler Options (-Wc,)" superClass="com.qnx.qcc.option.compiler.ccoptions" valueType="stringList">
<listOptionValue builtIn="false" value="-std=c99"/>
</option>
<inputType id="com.qnx.qcc.inputType.compiler.138334023" superClass="com.qnx.qcc.inputType.compiler"/>
</tool>
<tool id="com.qnx.qcc.tool.assembler.1481626526" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
<option id="com.qnx.qcc.option.assembler.debug.1677934085" name="Debug (-g)" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
<inputType id="com.qnx.qcc.inputType.assembler.1897789919" superClass="com.qnx.qcc.inputType.assembler"/>
</tool>
<tool id="com.qnx.qcc.tool.linker.1734281191" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
<option id="com.qnx.qcc.option.linker.debug.786130179" name="Debug (-g)" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.coverage.1368204059" name="Build for Code Coverage (-ftest-coverage -fprofile-arcs -p)" superClass="com.qnx.qcc.option.linker.coverage" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.langcpp.1440402215" name="C++ (-lang-c++)" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.security.701229622" name="Enhanced Security (-Wl,-z,relro -Wl,-z,now)" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
<option id="com.qnx.qcc.option.linker.libraryPaths.1606597329" name="Library Paths (-L)" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/lib"/>
<listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/${CPUVARDIR}/usr/lib"/>
</option>
</tool>
<tool id="com.qnx.qcc.tool.archiver.2046518299" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="chipmunk.null.1398136466" name="chipmunk"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.coverage.1076645199">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.coverage.1505898052">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.debug.1289808599">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.profile.1140302231">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.profile.213348384">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.release.1074854256">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.debug.1616529407">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="com.qnx.tools.ide.qde.core.QNXProjectProperties"/>
<storageModule moduleId="refreshScope" versionNumber="1">
<resource resourceType="PROJECT" workspacePath="/chipmunk"/>
</storageModule>
</cproject>

View File

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>chipmunk</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
<value>${workspace_loc:/chipmunk/Device-Profile}</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>com.qnx.tools.ide.bbt.core.bbtnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
</natures>
<linkedResources>
<link>
<name>include</name>
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOC/include</locationURI>
</link>
<link>
<name>src</name>
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOC/src</locationURI>
</link>
</linkedResources>
</projectDescription>

View File

@ -27,6 +27,7 @@ THE SOFTWARE.
#include <string.h>
#include <stdlib.h>
using namespace std;
typedef std::vector<std::string> strArray;

View File

@ -28,7 +28,7 @@ THE SOFTWARE.
/*#include "Availability.h"*/
#include "CCParticleSystem.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) || (CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
#include "CCParticleSystemQuad.h"
#endif
@ -48,7 +48,7 @@ Features:
Limitations:
* On 3rd gen iPhone devices and iPads, this node performs MUCH slower than CCParticleSystemQuad.
*/
#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) || (CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
class CC_DLL CCParticleSystemPoint : public CCParticleSystemQuad{
//nothing to do
};

View File

@ -28,7 +28,7 @@ THE SOFTWARE.
namespace cocos2d {
#if (CC_TARGET_PLATFORM != CC_PLATFORM_LINUX)
#if (CC_TARGET_PLATFORM != CC_PLATFORM_LINUX) && (CC_TARGET_PLATFORM != CC_PLATFORM_QNX)
//implementation CCParticleSystemPoint
bool CCParticleSystemPoint::initWithTotalParticles(unsigned int numberOfParticles)
@ -126,8 +126,10 @@ void CCParticleSystemPoint::draw()
glColorPointer(4, GL_UNSIGNED_BYTE, kPointSize,(GLvoid*)offsetof(ccPointSprite,color) );
glEnableClientState(GL_POINT_SIZE_ARRAY_OES);
glEnableClientState(GL_POINT_SIZE_ARRAY_OES);
glPointSizePointerOES(GL_FLOAT,kPointSize,(GLvoid*) offsetof(ccPointSprite,size) );
#else // Uses Vertex Array List
int offset = (int)m_pVertices;
glVertexPointer(2,GL_FLOAT, kPointSize, (GLvoid*) offset);

View File

@ -40,6 +40,8 @@ THE SOFTWARE.
#include "Linux/CCAccelerometer_linux.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_BADA)
#include "bada/CCAccelerometer_bada.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
#include "qnx/CCAccelerometer_qnx.h"
#else
#error
#endif

View File

@ -41,6 +41,8 @@ THE SOFTWARE.
#include "Linux/CCAplication_linux.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_BADA)
#include "bada/CCApplication_bada.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
#include "qnx/CCApplication_qnx.h"
#else
#error
#endif

View File

@ -35,7 +35,8 @@
(CC_TARGET_PLATFORM == CC_PLATFORM_WOPHONE) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_BADA)
(CC_TARGET_PLATFORM == CC_PLATFORM_BADA) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
#include "CCParticleSystemQuad.h"
#define ARCH_OPTIMAL_PARTICLE_SYSTEM CCParticleSystemQuad

View File

@ -289,3 +289,37 @@ void CCMessageBox(const char * pszMsg, const char * pszTitle)
NS_CC_END;
#endif // CC_PLATFORM_BADA
/****************************************************
* qnx
***************************************************/
#if (CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
#include <cstdio>
#include <cstdarg>
#include <stdio.h>
#include <stdarg.h>
using namespace std;
NS_CC_BEGIN;
void CCLog(const char * pszFormat, ...)
{
char buf[MAX_LEN];
va_list args;
va_start(args, pszFormat);
vsprintf(buf, pszFormat, args);
va_end(args);
fprintf(stderr, "cocos2d-x debug info [%s]\n", buf);
}
void CCMessageBox(const char * pszMsg, const char * pszTitle)
{
CCLog("%s: %s", pszTitle, pszMsg);
}
NS_CC_END;
#endif // CC_PLATFORM_QNX

View File

@ -41,6 +41,8 @@ THE SOFTWARE.
#include "Linux/CCEGLView_linux.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_BADA)
#include "bada/CCEGLView_bada.h"
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
#include "qnx/CCEGLView_qnx.h"
#else
#error
#endif

View File

@ -376,4 +376,8 @@ NS_CC_END;
#include "bada/CCFileUtils_bada.cpp"
#endif
#if (CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
#include "qnx/CCFileUtils_qnx.cpp"
#endif
#endif // (CC_TARGET_PLATFORM != CC_PLATFORM_IOS && CC_TARGET_PLATFORM != CC_PLATFORM_AIRPLAY)

View File

@ -34,12 +34,21 @@ THE SOFTWARE.
#define CC_GLVIEW cocos2d::CCEGLView
#define ccglOrtho glOrthof
#define ccglClearDepth glClearDepthf
#if (CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
#define ccglGenerateMipmap CCEGLView::glGenerateMipmapOES
#define ccglGenFramebuffers CCEGLView::glGenFramebuffersOES
#define ccglBindFramebuffer CCEGLView::glBindFramebufferOES
#define ccglFramebufferTexture2D CCEGLView::glFramebufferTexture2DOES
#define ccglDeleteFramebuffers CCEGLView::glDeleteFramebuffersOES
#define ccglCheckFramebufferStatus CCEGLView::glCheckFramebufferStatusOES
#else
#define ccglGenerateMipmap glGenerateMipmapOES
#define ccglGenFramebuffers glGenFramebuffersOES
#define ccglBindFramebuffer glBindFramebufferOES
#define ccglFramebufferTexture2D glFramebufferTexture2DOES
#define ccglDeleteFramebuffers glDeleteFramebuffersOES
#define ccglCheckFramebufferStatus glCheckFramebufferStatusOES
#endif
#define ccglTranslate glTranslatef
#define CC_GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
@ -148,7 +157,11 @@ extern PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB;
#if (CC_TARGET_PLATFORM == CC_PLATFORM_BADA)
#include "GLES/gl.h"
#include "GLES/glext.h"
#endif
#if (CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
#include <GLES/gl.h>
#include <GLES/glext.h>
#endif
NS_CC_BEGIN;

View File

@ -615,3 +615,7 @@ NS_CC_END;
#if (CC_TARGET_PLATFORM == CC_PLATFORM_BADA)
#include "bada/CCImage_bada.cpp"
#endif
#if (CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
#include "qnx/CCImage_qnx.cpp"
#endif

View File

@ -43,9 +43,10 @@ build for which target platform
#define CC_PLATFORM_WOPHONE 3
#define CC_PLATFORM_WIN32 4
#define CC_PLATFORM_AIRPLAY 5
#define CC_PLATFORM_LINUX 7
#define CC_PLATFORM_LINUX 6
#define CC_PLATFORM_BADA 7
#define CC_PLATFORM_QNX 8
#define CC_PLATFORM_BADA 6
// Determine tartet platform by compile environment macro.
#define CC_TARGET_PLATFORM CC_PLATFORM_UNKNOWN
@ -99,6 +100,13 @@ build for which target platform
#undef CC_TARGET_PLATFORM
#define CC_TARGET_PLATFORM CC_PLATFORM_BADA
#endif
// qnx
#if ! CC_TARGET_PLATFORM && defined(__QNX__)
#undef CC_TARGET_PLATFORM
#define CC_TARGET_PLATFORM CC_PLATFORM_QNX
#endif
//////////////////////////////////////////////////////////////////////////
// user configure
//////////////////////////////////////////////////////////////////////////
@ -138,6 +146,11 @@ build for which target platform
#define CC_TARGET_PLATFORM CC_PLATFORM_BADA
#endif
#if defined(CC_UNDER_QNX)
#undef CC_TARGET_PLATFORM
#define CC_TARGET_PLATFORM CC_PLATFORM_QNX
#endif
// Check user assigned supportive of multi-thread
#if defined(CC_ENABLE_MULTITHREAD)
#undef CC_SUPPORT_MULTITHREAD

View File

@ -39,7 +39,7 @@ Basically,it's only enabled in android
It's new in cocos2d-x since v0.99.5
*/
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
#define CC_ENABLE_CACHE_TEXTTURE_DATA 1
#else
#define CC_ENABLE_CACHE_TEXTTURE_DATA 0

View File

@ -29,7 +29,16 @@
NS_CC_BEGIN;
// libxml2 on most platforms are using "unsigned char" as type of string, while on airplay sdk using "char"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WOPHONE) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_BADA) || \
(CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
typedef unsigned char CC_XML_CHAR;
#endif
class CC_DLL CCSAXDelegator
{

View File

@ -87,7 +87,7 @@ int CC_DLL gettimeofday(struct timeval *, struct timezone *);
#endif // CC_PLATFORM_WIN32
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_QNX)
#include <sys/time.h>

View File

@ -0,0 +1,81 @@
/****************************************************************************
Copyright (c) 2010 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCAccelerometer_qnx.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <bps/accelerometer.h>
#include <fcntl.h>
#define BUFFER_SIZE 30
namespace cocos2d
{
CCAccelerometer* CCAccelerometer::m_spCCAccelerometer = NULL;
CCAccelerometer::CCAccelerometer()
{
m_pAccelDelegate = NULL;
accelerometer_set_update_frequency(FREQ_40_HZ);
}
CCAccelerometer::~CCAccelerometer()
{
}
CCAccelerometer* CCAccelerometer::sharedAccelerometer()
{
if (m_spCCAccelerometer == NULL)
m_spCCAccelerometer = new CCAccelerometer();
return m_spCCAccelerometer;
}
void CCAccelerometer::setDelegate(CCAccelerometerDelegate* pDelegate)
{
m_pAccelDelegate = pDelegate;
}
void CCAccelerometer::update(long timeStamp)
{
if ( m_pAccelDelegate != NULL)
{
double x, y, z;
accelerometer_read_forces(&x, &y, &z);
m_accelerationValue.x = x;
m_accelerationValue.y = y;
m_accelerationValue.z = z;
m_accelerationValue.timestamp = (double)timeStamp;
m_pAccelDelegate->didAccelerate(&m_accelerationValue);
}
}
} // end of namespace cococs2d

View File

@ -0,0 +1,54 @@
/****************************************************************************
Copyright (c) 2010 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __PLATFORM_QNX_CCACCELEROMETER_H__
#define __PLATFORM_QNX_CCACCELEROMETER_H__
#include "CCCommon.h"
#include "CCAccelerometerDelegate.h"
#include <list>
namespace cocos2d {
class CC_DLL CCAccelerometer
{
public:
CCAccelerometer();
~CCAccelerometer();
static CCAccelerometer* sharedAccelerometer();
void setDelegate(CCAccelerometerDelegate* pDelegate);
void update(long sensorTimeStamp);
private:
static CCAccelerometer* m_spCCAccelerometer;
CCAccelerometerDelegate* m_pAccelDelegate;
CCAcceleration m_accelerationValue;
};
}//namespace cocos2d
#endif

View File

@ -0,0 +1,108 @@
#include "CCApplication.h"
#include "CCDirector.h"
#include "CCEGLView.h"
#include "CCAccelerometer.h"
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#define LOGD(...) fprintf(stderr, __VA_ARGS__)
NS_CC_BEGIN;
// sharedApplication pointer
CCApplication * CCApplication::sm_pSharedApplication = 0;
long CCApplication::m_animationInterval = 1000;
// convert the timespec into milliseconds
static long time2millis(struct timespec *times)
{
return times->tv_sec*1000 + times->tv_nsec/1000000;
}
CCApplication::CCApplication()
{
CC_ASSERT(! sm_pSharedApplication);
sm_pSharedApplication = this;
}
CCApplication::~CCApplication()
{
CC_ASSERT(this == sm_pSharedApplication);
sm_pSharedApplication = NULL;
}
int CCApplication::run()
{
struct timespec time_struct;
long current_time, update_time;
// Initialize instance and cocos2d.
if (!initInstance() || !applicationDidFinishLaunching())
{
return 0;
}
clock_gettime(CLOCK_REALTIME, &time_struct);
update_time = time2millis(&time_struct);
while (1) // or device wants to quit
{
CCEGLView::sharedOpenGLView().HandleEvents();
clock_gettime(CLOCK_REALTIME, &time_struct);
current_time = time2millis(&time_struct);
if ((current_time - update_time) > m_animationInterval)
{
update_time = current_time;
CCAccelerometer::sharedAccelerometer()->update(current_time);
CCDirector::sharedDirector()->mainLoop();
}
else
{
// sleep(0);
}
}
return -1;
}
void CCApplication::setAnimationInterval(double interval)
{
// interval in milliseconds
m_animationInterval = (long)(interval * 1000);
}
CCApplication::Orientation CCApplication::setOrientation(Orientation orientation)
{
return orientation;
}
void CCApplication::statusBarFrame(CCRect * rect)
{
if (rect)
{
// qnx doesn't have a status bar
*rect = CCRectMake(0, 0, 0, 0);
}
}
//////////////////////////////////////////////////////////////////////////
// static member function
//////////////////////////////////////////////////////////////////////////
CCApplication& CCApplication::sharedApplication()
{
CC_ASSERT(sm_pSharedApplication);
return *sm_pSharedApplication;
}
ccLanguageType CCApplication::getCurrentLanguage()
{
return kLanguageEnglish;
}
NS_CC_END;

View File

@ -0,0 +1,100 @@
#ifndef __CC_APPLICATION_QNX_H__
#define __CC_APPLICATION_QNX_H__
#include "CCApplication.h"
#include "CCCommon.h"
NS_CC_BEGIN;
class CCRect;
class CC_DLL CCApplication
{
public:
CCApplication();
virtual ~CCApplication();
/**
@brief Implement for initialize OpenGL instance, set source path, etc...
*/
virtual bool initInstance() = 0;
/**
@brief Implement CCDirector and CCScene init code here.
@return true Initialize success, app continue.
@return false Initialize failed, app terminate.
*/
virtual bool applicationDidFinishLaunching() = 0;
/**
@brief The function be called when the application enter background
@param the pointer of the application
*/
virtual void applicationDidEnterBackground() = 0;
/**
@brief The function be called when the application enter foreground
@param the pointer of the application
*/
virtual void applicationWillEnterForeground() = 0;
/**
@brief Callback by CCDirector for limit FPS.
@interval The time, which expressed in second in second, between current frame and next.
*/
void setAnimationInterval(double interval);
typedef enum
{
/// Device oriented vertically, home button on the bottom
kOrientationPortrait = 0,
/// Device oriented vertically, home button on the top
kOrientationPortraitUpsideDown = 1,
/// Device oriented horizontally, home button on the right
kOrientationLandscapeLeft = 2,
/// Device oriented horizontally, home button on the left
kOrientationLandscapeRight = 3,
} Orientation;
/**
@brief Callback by CCDirector for change device orientation.
@orientation The defination of orientation which CCDirector want change to.
@return The actual orientation of the application.
*/
Orientation setOrientation(Orientation orientation);
/**
@brief Get status bar rectangle in EGLView window.
*/
void statusBarFrame(CCRect * rect);
/**
@brief Run the message loop.
*/
int run();
/**
@brief Get current applicaiton instance.
@return Current application instance pointer.
*/
static CCApplication& sharedApplication();
/**
@brief Get current language config
@return Current language config
*/
static ccLanguageType getCurrentLanguage();
protected:
static CCApplication * sm_pSharedApplication;
private:
static long m_animationInterval;
};
NS_CC_END;
#endif // __CCX_APPLICATION_QNX_H__

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,121 @@
/****************************************************************************
Copyright (c) 2010 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __CC_EGLVIEW_QNX_H__
#define __CC_EGLVIEW_QNX_H__
#include "CCGeometry.h"
#include <GLES/gl.h>
#include <GLES/glext.h>
#include <EGL/egl.h>
#include <screen/screen.h>
namespace cocos2d {
class CCSet;
class CCTouch;
class EGLTouchDelegate;
class CC_DLL CCEGLView
{
public:
CCEGLView();
virtual ~CCEGLView();
CCSize getSize();
bool isOpenGLReady();
/**
* the width and height is the real size of phone
*/
void setFrameWidthAndHeight(int width, int height);
/**
* create a drawing rect,
* the width and heiht is the resource size match best
*/
bool Create(int width, int height);
EGLTouchDelegate* getDelegate(void);
// keep compatible
void release();
void setTouchDelegate(EGLTouchDelegate * pDelegate);
void swapBuffers();
bool canSetContentScaleFactor();
void setContentScaleFactor(float contentScaleFactor);
void setViewPortInPoints(float x, float y, float w, float h);
void setScissorInPoints(float x, float y, float w, float h);
CCRect getViewPort();
float getScreenScaleFactor();
void setIMEKeyboardState(bool bOpen);
bool HandleEvents();
// static function
/**
@brief get the shared main open gl window
*/
static CCEGLView& sharedOpenGLView();
// pointer to OES methods from EGL
static PFNGLGENERATEMIPMAPOESPROC glGenerateMipmapOES;
static PFNGLGENFRAMEBUFFERSOESPROC glGenFramebuffersOES;
static PFNGLBINDFRAMEBUFFEROESPROC glBindFramebufferOES;
static PFNGLFRAMEBUFFERTEXTURE2DOESPROC glFramebufferTexture2DOES;
static PFNGLDELETEFRAMEBUFFERSOESPROC glDeleteFramebuffersOES;
static PFNGLCHECKFRAMEBUFFERSTATUSOESPROC glCheckFramebufferStatusOES;
private:
bool initGL();
void initEGLFunctions();
bool isGLExtension(const char *searchName) const;
bool initDriver();
void printEGLInfo(const EGLConfig &config) const;
EGLConfig chooseConfig(const EGLDisplay &eglDisplay, const char* str);
int chooseFormat(const EGLDisplay &eglDisplay, const EGLConfig &config);
bool createNativeWindow(const EGLConfig &config);
void showKeyboard();
void hideKeyboard();
CCSize m_sSizeInPixel;
CCSize m_sSizeInPoint;
CCRect m_rcViewPort;
bool m_bNotHVGA;
bool m_isGLInitialized;
EGLTouchDelegate *m_pDelegate;
float m_fScreenScaleFactor;
static bool m_initializedFunctions;
static const GLubyte *m_extensions;
EGLDisplay m_eglDisplay;
EGLContext m_eglContext;
EGLSurface m_eglSurface;
screen_event_t m_screenEvent;
screen_window_t m_screenWindow;
screen_context_t m_screenContext;
};
} // end of namespace cocos2d
#endif // end of __CC_EGLVIEW_QNX_H__

View File

@ -0,0 +1,142 @@
/****************************************************************************
Copyright (c) 2010 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCFileUtils.h"
#include "CCCommon.h"
#include "CCString.h"
#include <string>
#include <unistd.h>
NS_CC_BEGIN;
#define MAX_PATH 256
// record the resource path
static std::string s_strResourcePath = "";
static std::string s_pszZipFilePath = "";
void CCFileUtils::setResourcePath(const char *pszResourcePath)
{
CCAssert(pszResourcePath != NULL, "[FileUtils setResourcePath] -- wrong resource path");
CCAssert(strlen(pszResourcePath) <= MAX_PATH, "[FileUtils setResourcePath] -- resource path too long");
if (!pszResourcePath)
return;
s_strResourcePath = pszResourcePath;
// if the path is not ended with '/', append it
if (s_strResourcePath.find("/") != (strlen(s_strResourcePath.c_str()) - 1))
{
s_strResourcePath += "/";
}
}
const char* CCFileUtils::fullPathFromRelativePath(const char *pszRelativePath)
{
return pszRelativePath;
}
const char *CCFileUtils::fullPathFromRelativeFile(const char *pszFilename, const char *pszRelativeFile)
{
std::string relativeFile = pszRelativeFile;
CCString *pRet = new CCString();
pRet->autorelease();
pRet->m_sString = relativeFile.substr(0, relativeFile.rfind('/')+1);
pRet->m_sString += pszFilename;
return pRet->m_sString.c_str();
}
unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* pszMode, unsigned long * pSize)
{
unsigned char * buffer = NULL;
// if specify the zip file,load from it first
if (s_pszZipFilePath[0] != 0)
{
buffer = getFileDataFromZip(s_pszZipFilePath.c_str(), pszFileName, pSize);
}
// if that failed then let's try and load the file ourselves
if (!buffer)
{
std::string full_path = s_strResourcePath + pszFileName;
// read the file from hardware
FILE *fp = fopen(full_path.c_str(), pszMode);
if (fp)
{
fseek(fp, 0, SEEK_END);
*pSize = ftell(fp);
fseek(fp, 0, SEEK_SET);
buffer = new unsigned char[*pSize];
*pSize = fread(buffer, sizeof(unsigned char), *pSize, fp);
fclose(fp);
}
}
// we couldn't find the file
if (!buffer && getIsPopupNotify())
{
std::string title = "Notification";
std::string msg = "Get data from file(";
msg.append(pszFileName);
if (s_pszZipFilePath[0] != 0)
{
msg.append(") in zip archive(").append(s_pszZipFilePath);
}
msg.append(") failed!");
CCMessageBox(msg.c_str(), title.c_str());
}
return buffer;
}
void CCFileUtils::setResource(const char* pszZipFileName)
{
s_pszZipFilePath = pszZipFileName;
}
int CCFileUtils::ccLoadFileIntoMemory(const char *filename, unsigned char **out)
{
CCAssert(0, "Have not implemented!");
return 0;
}
std::string CCFileUtils::getWriteablePath()
{
// Let's write it in the current working directory's data folder
char cwd[FILENAME_MAX];
getcwd(cwd, FILENAME_MAX - 1);
cwd[FILENAME_MAX] = '\0';
std::string path = cwd;
path += "/data/";
return path;
}
NS_CC_END;

View File

@ -0,0 +1,244 @@
/****************************************************************************
Copyright (c) 2010 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCImage.h"
#include "SkTypeface.h"
#include "SkBitmap.h"
#include "SkPaint.h"
#include "SkCanvas.h"
using namespace std;
NS_CC_BEGIN;
class BitmapDC
{
public:
BitmapDC() : m_pBitmap(NULL),
m_pPaint(NULL)
{
}
~BitmapDC(void)
{
CC_SAFE_DELETE(m_pPaint);
CC_SAFE_DELETE(m_pBitmap);
}
bool setFont(const char *pFontName = NULL, int nSize = 0)
{
bool bRet = false;
if (m_pPaint)
{
delete m_pPaint;
m_pPaint = NULL;
}
do
{
/* init paint */
m_pPaint = new SkPaint();
CC_BREAK_IF(! m_pPaint);
m_pPaint->setColor(SK_ColorWHITE);
m_pPaint->setTextSize(nSize);
/* create font */
SkTypeface *pTypeFace = SkTypeface::CreateFromName(pFontName, SkTypeface::kNormal);
if (! pTypeFace)
{
// let's replace with Arial first before failing
pTypeFace = SkTypeface::CreateFromName("Arial", SkTypeface::kNormal);
CCLOG("could not find font %s replacing with Arial\n", pFontName);
if (!pTypeFace)
{
CC_SAFE_DELETE(m_pPaint);
break;
}
}
m_pPaint->setTypeface( pTypeFace );
/* cannot unref, I don't know why. It may be memory leak, but how to avoid? */
pTypeFace->unref();
bRet = true;
} while (0);
return bRet;
}
bool prepareBitmap(int nWidth, int nHeight)
{
// release bitmap
if (m_pBitmap)
{
delete m_pBitmap;
m_pBitmap = NULL;
}
if (nWidth > 0 && nHeight > 0)
{
/* create and init bitmap */
m_pBitmap = new SkBitmap();
if (! m_pBitmap)
{
return false;
}
/* use rgba8888 and alloc memory */
m_pBitmap->setConfig(SkBitmap::kARGB_8888_Config, nWidth, nHeight);
if (! m_pBitmap->allocPixels())
{
CC_SAFE_DELETE(m_pBitmap);
return false;
}
/* start with black/transparent pixels */
m_pBitmap->eraseColor(0);
}
return true;
}
bool drawText(const char *pszText, int nWidth, int nHeight, CCImage::ETextAlign eAlignMask)
{
bool bRet = false;
do
{
CC_BREAK_IF(! pszText);
CC_BREAK_IF(! prepareBitmap(nWidth, nHeight));
/* create canvas */
SkPaint::FontMetrics font;
m_pPaint->getFontMetrics(&font);
SkCanvas canvas(*m_pBitmap);
/*
* draw text
* @todo: alignment
*/
canvas.drawText(pszText, strlen(pszText), 0.0, -font.fAscent, *m_pPaint);
bRet = true;
} while (0);
return bRet;
}
bool getTextExtentPoint(const char * pszText, int *pWidth, int *pHeight)
{
bool bRet = false;
do
{
CC_BREAK_IF(!pszText || !pWidth || !pHeight);
// get text width and height
if (m_pPaint)
{
SkPaint::FontMetrics font;
m_pPaint->getFontMetrics(&font);
*pHeight = (int)ceil((font.fDescent - font.fAscent));
*pWidth = (int)ceil((m_pPaint->measureText(pszText, strlen(pszText))));
bRet = true;
}
} while (0);
return bRet;
}
SkBitmap* getBitmap()
{
return m_pBitmap;
}
private:
SkPaint *m_pPaint;
SkBitmap *m_pBitmap;
};
static BitmapDC& sharedBitmapDC()
{
static BitmapDC s_BmpDC;
return s_BmpDC;
}
bool CCImage::initWithString(
const char * pText,
int nWidth/* = 0*/,
int nHeight/* = 0*/,
ETextAlign eAlignMask/* = kAlignCenter*/,
const char * pFontName/* = nil*/,
int nSize/* = 0*/)
{
bool bRet = false;
do
{
CC_BREAK_IF(! pText);
BitmapDC &dc = sharedBitmapDC();
/* init font with font name and size */
CC_BREAK_IF(! dc.setFont(pFontName, nSize));
/* compute text width and height */
if (nWidth <= 0 || nHeight <= 0)
{
dc.getTextExtentPoint(pText, &nWidth, &nHeight);
}
CC_BREAK_IF(nWidth <= 0 || nHeight <= 0);
CC_BREAK_IF( false == dc.drawText(pText, nWidth, nHeight, eAlignMask) );
/*init image information */
SkBitmap *pBitmap = dc.getBitmap();
CC_BREAK_IF(! pBitmap);
int nWidth = pBitmap->width();
int nHeight = pBitmap->height();
CC_BREAK_IF(nWidth <= 0 || nHeight <= 0);
int nDataLen = pBitmap->rowBytes() * pBitmap->height();
m_pData = new unsigned char[nDataLen];
CC_BREAK_IF(! m_pData);
memcpy((void*) m_pData, pBitmap->getPixels(), nDataLen);
m_nWidth = (short)nWidth;
m_nHeight = (short)nHeight;
m_bHasAlpha = true;
m_bPreMulti = true;
m_nBitsPerComponent = pBitmap->bytesPerPixel();
bRet = true;
} while (0);
return bRet;
}
NS_CC_END;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<bada>
<type>0</type>
<sdk>C:\bada\1.0.0</sdk>
<sdk>E:\bada\1.0.0</sdk>
<model>Wave_LP2</model>
<properties/>
</bada>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<bada>
<type>0</type>
<sdk>e:\bada\2.0.2</sdk>
<sdk>E:\bada\2.0.2</sdk>
<model>WaveWVGA</model>
<apiversioncheck>true</apiversioncheck>
<priviligecheck>false</priviligecheck>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<bada>
<type>0</type>
<sdk>C:\bada\1.0.0</sdk>
<sdk>E:\bada\1.0.0</sdk>
<model>Wave_LP2</model>
<properties/>
</bada>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<bada>
<type>0</type>
<sdk>e:\bada\2.0.2</sdk>
<sdk>E:\bada\2.0.2</sdk>
<model>WaveWVGA</model>
<apiversioncheck>true</apiversioncheck>
<priviligecheck>false</priviligecheck>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<bada>
<type>0</type>
<sdk>C:\bada\1.0.0</sdk>
<sdk>E:\bada\1.0.0</sdk>
<model>Wave_LP2</model>
<properties/>
</bada>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<bada>
<type>0</type>
<sdk>e:\bada\2.0.2</sdk>
<sdk>E:\bada\2.0.2</sdk>
<model>WaveWVGA</model>
<apiversioncheck>true</apiversioncheck>
<priviligecheck>false</priviligecheck>

View File

@ -0,0 +1,171 @@
class ARGB32_Clamp_Bilinear_BitmapShader : public SkBitmapShader {
public:
ARGB32_Clamp_Bilinear_BitmapShader(const SkBitmap& src)
: SkBitmapShader(src, true,
SkShader::kClamp_TileMode, SkShader::kClamp_TileMode)
{}
virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count);
};
SkPMColor sample_bilerp(SkFixed fx, SkFixed fy, unsigned srcMaxX, unsigned srcMaxY,
const SkPMColor* srcPixels, int srcRB, const SkFilterPtrProc* proc_table);
SkPMColor sample_bilerp(SkFixed fx, SkFixed fy, unsigned srcMaxX, unsigned srcMaxY,
const SkPMColor* srcPixels, int srcRB, const SkFilterPtrProc* proc_table)
{
int ix = fx >> 16;
int iy = fy >> 16;
const SkPMColor *p00, *p01, *p10, *p11;
p00 = p01 = ((const SkPMColor*)((const char*)srcPixels
+ SkClampMax(iy, srcMaxY) * srcRB))
+ SkClampMax(ix, srcMaxX);
if ((unsigned)ix < srcMaxX)
p01 += 1;
p10 = p00;
p11 = p01;
if ((unsigned)iy < srcMaxY)
{
p10 = (const SkPMColor*)((const char*)p10 + srcRB);
p11 = (const SkPMColor*)((const char*)p11 + srcRB);
}
SkFilterPtrProc proc = SkGetBilinearFilterPtrProc(proc_table, fx, fy);
return proc(p00, p01, p10, p11);
}
static inline SkPMColor sample_bilerpx(SkFixed fx, unsigned srcMaxX, const SkPMColor* srcPixels,
int srcRB, const SkFilterPtrProc* proc_table)
{
int ix = fx >> 16;
const SkPMColor *p00, *p01, *p10, *p11;
p00 = p01 = srcPixels + SkClampMax(ix, srcMaxX);
if ((unsigned)ix < srcMaxX)
p01 += 1;
p10 = (const SkPMColor*)((const char*)p00 + srcRB);
p11 = (const SkPMColor*)((const char*)p01 + srcRB);
SkFilterPtrProc proc = SkGetBilinearFilterPtrXProc(proc_table, fx);
return proc(p00, p01, p10, p11);
}
void ARGB32_Clamp_Bilinear_BitmapShader::shadeSpan(int x, int y, SkPMColor dstC[], int count)
{
SkASSERT(count > 0);
unsigned srcScale = SkAlpha255To256(this->getPaintAlpha());
const SkMatrix& inv = this->getTotalInverse();
const SkBitmap& srcBitmap = this->getSrcBitmap();
unsigned srcMaxX = srcBitmap.width() - 1;
unsigned srcMaxY = srcBitmap.height() - 1;
unsigned srcRB = srcBitmap.rowBytes();
const SkFilterPtrProc* proc_table = SkGetBilinearFilterPtrProcTable();
const SkPMColor* srcPixels = (const SkPMColor*)srcBitmap.getPixels();
if (this->getInverseClass() == kPerspective_MatrixClass)
{
SkPerspIter iter(inv, SkIntToScalar(x) + SK_ScalarHalf,
SkIntToScalar(y) + SK_ScalarHalf, count);
if (256 == srcScale)
{
while ((count = iter.next()) != 0)
{
const SkFixed* srcXY = iter.getXY();
while (--count >= 0)
{
SkFixed fx = *srcXY++ - SK_FixedHalf;
SkFixed fy = *srcXY++ - SK_FixedHalf;
*dstC++ = sample_bilerp(fx, fy, srcMaxX, srcMaxY, srcPixels, srcRB, proc_table);
}
}
}
else // scale by srcScale
{
while ((count = iter.next()) != 0)
{
const SkFixed* srcXY = iter.getXY();
while (--count >= 0)
{
SkFixed fx = *srcXY++ - SK_FixedHalf;
SkFixed fy = *srcXY++ - SK_FixedHalf;
SkPMColor c = sample_bilerp(fx, fy, srcMaxX, srcMaxY, srcPixels, srcRB, proc_table);
*dstC++ = SkAlphaMulQ(c, srcScale);
}
}
}
}
else // linear case
{
SkFixed fx, fy, dx, dy;
// now init fx, fy, dx, dy
{
SkPoint srcPt;
this->getInverseMapPtProc()(inv, SkIntToScalar(x) + SK_ScalarHalf,
SkIntToScalar(y) + SK_ScalarHalf,
&srcPt);
fx = SkScalarToFixed(srcPt.fX) - SK_FixedHalf;
fy = SkScalarToFixed(srcPt.fY) - SK_FixedHalf;
if (this->getInverseClass() == kFixedStepInX_MatrixClass)
(void)inv.fixedStepInX(SkIntToScalar(y), &dx, &dy);
else
{
dx = SkScalarToFixed(inv.getScaleX());
dy = SkScalarToFixed(inv.getSkewY());
}
}
if (dy == 0 && (unsigned)(fy >> 16) < srcMaxY)
{
srcPixels = (const SkPMColor*)((const char*)srcPixels + (fy >> 16) * srcRB);
proc_table = SkGetBilinearFilterPtrProcYTable(proc_table, fy);
if (256 == srcScale)
{
do {
*dstC++ = sample_bilerpx(fx, srcMaxX, srcPixels, srcRB, proc_table);
fx += dx;
} while (--count != 0);
}
else
{
do {
SkPMColor c = sample_bilerpx(fx, srcMaxX, srcPixels, srcRB, proc_table);
*dstC++ = SkAlphaMulQ(c, srcScale);
fx += dx;
} while (--count != 0);
}
}
else // dy is != 0
{
if (256 == srcScale)
{
do {
*dstC++ = sample_bilerp(fx, fy, srcMaxX, srcMaxY, srcPixels, srcRB, proc_table);
fx += dx;
fy += dy;
} while (--count != 0);
}
else
{
do {
SkPMColor c = sample_bilerp(fx, fy, srcMaxX, srcMaxY, srcPixels, srcRB, proc_table);
*dstC++ = SkAlphaMulQ(c, srcScale);
fx += dx;
fy += dy;
} while (--count != 0);
}
}
}
}

View File

@ -0,0 +1,58 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef SkFlingState_DEFINED
#define SkFlingState_DEFINED
#include "SkScalar.h"
#include "SkPoint.h"
class SkMatrix;
struct FlingState {
FlingState() : fActive(false) {}
bool isActive() const { return fActive; }
void stop() { fActive = false; }
void reset(float sx, float sy);
bool evaluateMatrix(SkMatrix* matrix);
private:
SkPoint fDirection;
SkScalar fSpeed0;
double fTime0;
bool fActive;
};
class GrAnimateFloat {
public:
GrAnimateFloat();
void start(float v0, float v1, float duration);
bool isActive() const { return fTime0 != 0; }
void stop() { fTime0 = 0; }
float evaluate();
private:
float fValue0, fValue1, fDuration;
SkMSec fTime0;
};
#endif

View File

@ -0,0 +1,37 @@
class GrAPI {
public:
void setRenderTarget(GrRenderTarget* target);
void setMatrix(const GrMatrix&);
void setClip(rect, bool aa);
void setClip(rect[], bool aa);
void setClip(path, bool aa);
void setClip(rect, texture/key, state, matrix);
void setClip(path, texture/key, state, matrix);
void setColor(color);
void setTexture(texture/key, sampler, const GrMatrix* = NULL);
void setBlend(src, dst);
void drawRect(const GrRect&, stroke, join);
void drawOval(const GrRect&, stroke);
void drawRoundRect(const GrRect&, GrScalar ovalW, GrScalar ovalH, stroke);
void drawPath(const GrPathIter&, GrPathFill);
void drawVertices(...);
void drawGlyphs(const uint16_t[], int count, const GrPoint[], GrFontScaler*);
///
void save();
void restore();
void concatMatrix(const GrMatrix&);
void concatClipRect(const GrRect&);
void concatClipPath(const GrPathIter&, bool aa);
};

View File

@ -0,0 +1,71 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrAllocPool_DEFINED
#define GrAllocPool_DEFINED
#include "GrNoncopyable.h"
class GrAllocPool : GrNoncopyable {
public:
GrAllocPool(size_t blockSize = 0);
~GrAllocPool();
/**
* Frees all blocks that have been allocated with alloc().
*/
void reset();
/**
* Returns a block of memory bytes size big. This address must not be
* passed to realloc/free/delete or any other function that assumes the
* address was allocated by malloc or new (because it hasn't).
*/
void* alloc(size_t bytes);
/**
* Releases the most recently allocated bytes back to allocpool.
*/
void release(size_t bytes);
private:
struct Block;
Block* fBlock;
size_t fMinBlockSize;
#if GR_DEBUG
int fBlocksAllocated;
void validate() const;
#else
void validate() const {}
#endif
};
template <typename T> class GrTAllocPool {
public:
GrTAllocPool(int count) : fPool(count * sizeof(T)) {}
void reset() { fPool.reset(); }
T* alloc() { return (T*)fPool.alloc(sizeof(T)); }
private:
GrAllocPool fPool;
};
#endif

View File

@ -0,0 +1,240 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrAllocator_DEFINED
#define GrAllocator_DEFINED
#include "GrConfig.h"
#include "GrTArray.h"
class GrAllocator {
public:
virtual ~GrAllocator() {
reset();
}
/**
* Create an allocator
*
* @param itemSize the size of each item to allocate
* @param itemsPerBlock the number of items to allocate at once
* @param initialBlock optional memory to use for the first block.
* Must be at least itemSize*itemsPerBlock sized.
* Caller is responsible for freeing this memory.
*/
GrAllocator(size_t itemSize, int itemsPerBlock, void* initialBlock) :
fBlocks(fBlockInitialStorage, NUM_INIT_BLOCK_PTRS),
fItemSize(itemSize),
fItemsPerBlock(itemsPerBlock),
fOwnFirstBlock(NULL == initialBlock),
fCount(0) {
GrAssert(itemsPerBlock > 0);
fBlockSize = fItemSize * fItemsPerBlock;
fBlocks.push_back() = initialBlock;
GR_DEBUGCODE(if (!fOwnFirstBlock) {*((char*)initialBlock+fBlockSize-1)='a';} );
}
/**
* Adds an item and returns pointer to it.
*
* @return pointer to the added item.
*/
void* push_back() {
int indexInBlock = fCount % fItemsPerBlock;
// we always have at least one block
if (0 == indexInBlock) {
if (0 != fCount) {
fBlocks.push_back() = GrMalloc(fBlockSize);
} else if (fOwnFirstBlock) {
fBlocks[0] = GrMalloc(fBlockSize);
}
}
void* ret = (char*)fBlocks[fCount/fItemsPerBlock] +
fItemSize * indexInBlock;
++fCount;
return ret;
}
/**
* removes all added items
*/
void reset() {
int blockCount = GrMax((unsigned)1,
GrUIDivRoundUp(fCount, fItemsPerBlock));
for (int i = 1; i < blockCount; ++i) {
GrFree(fBlocks[i]);
}
if (fOwnFirstBlock) {
GrFree(fBlocks[0]);
fBlocks[0] = NULL;
}
fBlocks.pop_back_n(blockCount-1);
fCount = 0;
}
/**
* count of items
*/
int count() const {
return fCount;
}
/**
* is the count 0
*/
bool empty() const { return fCount == 0; }
/**
* access last item, only call if count() != 0
*/
void* back() {
GrAssert(fCount);
return (*this)[fCount-1];
}
/**
* access last item, only call if count() != 0
*/
const void* back() const {
GrAssert(fCount);
return (*this)[fCount-1];
}
/**
* access item by index.
*/
void* operator[] (int i) {
GrAssert(i >= 0 && i < fCount);
return (char*)fBlocks[i / fItemsPerBlock] +
fItemSize * (i % fItemsPerBlock);
}
/**
* access item by index.
*/
const void* operator[] (int i) const {
GrAssert(i >= 0 && i < fCount);
return (const char*)fBlocks[i / fItemsPerBlock] +
fItemSize * (i % fItemsPerBlock);
}
private:
static const int NUM_INIT_BLOCK_PTRS = 8;
GrTArray<void*> fBlocks;
size_t fBlockSize;
char fBlockInitialStorage[NUM_INIT_BLOCK_PTRS*sizeof(void*)];
size_t fItemSize;
int fItemsPerBlock;
bool fOwnFirstBlock;
int fCount;
};
template <typename T>
class GrTAllocator {
private:
GrAllocator fAllocator;
public:
virtual ~GrTAllocator() {};
/**
* Create an allocator
*
* @param itemsPerBlock the number of items to allocate at once
* @param initialBlock optional memory to use for the first block.
* Must be at least size(T)*itemsPerBlock sized.
* Caller is responsible for freeing this memory.
*/
GrTAllocator(int itemsPerBlock, void* initialBlock)
: fAllocator(sizeof(T), itemsPerBlock, initialBlock) {}
/**
* Create an allocator using a GrAlignedTAlloc as the initial block.
*
* @param initialBlock specifies the storage for the initial block
* and the size of subsequent blocks.
*/
template <int N>
GrTAllocator(GrAlignedSTStorage<N,T>* initialBlock)
: fAllocator(sizeof(T), N, initialBlock->get()) {}
/**
* Adds an item and returns it.
*
* @return the added item.
*/
T& push_back() {
void* item = fAllocator.push_back();
GrAssert(NULL != item);
new (item) T;
return *(T*)item;
}
/**
* removes all added items
*/
void reset() {
int c = fAllocator.count();
for (int i = 0; i < c; ++i) {
((T*)fAllocator[i])->~T();
}
fAllocator.reset();
}
/**
* count of items
*/
int count() const {
return fAllocator.count();
}
/**
* is the count 0
*/
bool empty() const { return fAllocator.empty(); }
/**
* access last item, only call if count() != 0
*/
T& back() {
return *(T*)fAllocator.back();
}
/**
* access last item, only call if count() != 0
*/
const T& back() const {
return *(const T*)fAllocator.back();
}
/**
* access item by index.
*/
T& operator[] (int i) {
return *(T*)(fAllocator[i]);
}
/**
* access item by index.
*/
const T& operator[] (int i) const {
return *(const T*)(fAllocator[i]);
}
};
#endif

View File

@ -0,0 +1,91 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrAtlas_DEFINED
#define GrAtlas_DEFINED
#include "GrPoint.h"
#include "GrTexture.h"
#include "GrTDArray.h"
class GrGpu;
class GrRectanizer;
class GrAtlasMgr;
class GrAtlas {
public:
GrAtlas(GrAtlasMgr*, int plotX, int plotY, GrMaskFormat);
int getPlotX() const { return fPlot.fX; }
int getPlotY() const { return fPlot.fY; }
GrMaskFormat getMaskFormat() const { return fMaskFormat; }
GrTexture* texture() const { return fTexture; }
bool addSubImage(int width, int height, const void*, GrIPoint16*);
static void FreeLList(GrAtlas* atlas) {
while (atlas) {
GrAtlas* next = atlas->fNext;
delete atlas;
atlas = next;
}
}
// testing
GrAtlas* nextAtlas() const { return fNext; }
private:
~GrAtlas(); // does not try to delete the fNext field
GrAtlas* fNext;
GrTexture* fTexture;
GrRectanizer* fRects;
GrAtlasMgr* fAtlasMgr;
GrIPoint16 fPlot;
GrMaskFormat fMaskFormat;
friend class GrAtlasMgr;
};
class GrPlotMgr;
class GrAtlasMgr {
public:
GrAtlasMgr(GrGpu*);
~GrAtlasMgr();
GrAtlas* addToAtlas(GrAtlas*, int width, int height, const void*,
GrMaskFormat, GrIPoint16*);
GrTexture* getTexture(GrMaskFormat format) const {
GrAssert((unsigned)format < kCount_GrMaskFormats);
return fTexture[format];
}
// to be called by ~GrAtlas()
void freePlot(int x, int y);
private:
GrGpu* fGpu;
GrTexture* fTexture[kCount_GrMaskFormats];
GrPlotMgr* fPlotMgr;
};
#endif

View File

@ -0,0 +1,237 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrBinHashKey_DEFINED
#define GrBinHashKey_DEFINED
#include "GrTypes.h"
/**
* Abstract base class that presents the building interface of GrBinHashKey.
* This base class allows builder methods to not know the exact template
* parameters of GrBinHashKey
*/
class GrBinHashKeyBuilder {
public:
GrBinHashKeyBuilder() {}
virtual ~GrBinHashKeyBuilder() {}
virtual void keyData(const uint32_t *dataToAdd, size_t len) = 0;
};
/**
* Hash function class than can take a data stream of indeterminate length.
* It also has the ability to recieve data in several chunks (steamed). The
* hash function used is the One-at-a-Time Hash
* (http://burtleburtle.net/bob/hash/doobs.html).
*
* Keys are built in two passes the first pass builds the key until the
* allocated storage for the key runs out, raw data accumulation stops, but
* the calculation of the 32-bit hash value and total key length continue.
* The second pass is only necessary if storage ran-out during the first pass.
* If that is the case, the heap storage portion of the key will be
* re-allocated so that the entire key can be stored in the second pass.
*
* Code for building a key:
*
* GrBinHashKey<MyEntryStruct, MyStackSize> MyKey;
* while( MyKey->doPass() )
* {
* MyObject->buildKey(&MyKey); //invoke a builder method
* }
*
* All the builder method needs to do is make calls to the keyData method to
* append binary data to the key.
*/
template<typename Entry, size_t StackSize>
class GrBinHashKey : public GrBinHashKeyBuilder {
public:
GrBinHashKey()
: fA(0)
, fLength(0)
, fHeapData(NULL)
, fPhysicalSize(StackSize)
, fUseHeap(false)
, fPass(0)
#if GR_DEBUG
, fIsValid(true)
#endif
{}
private:
// Illegal: must choose explicitly between copyAndTakeOwnership
// and deepCopyFrom.
// Not inheriting GrNoncopyable, because it causes very obscure compiler
// errors with template classes, which are hard to trace back to the use
// of assignment.
GrBinHashKey(const GrBinHashKey<Entry, StackSize>&) {}
GrBinHashKey<Entry, StackSize>& operator=(const GrBinHashKey<Entry,
StackSize>&) {
return this;
}
public:
void copyAndTakeOwnership(GrBinHashKey<Entry, StackSize>& key) {
GrAssert(key.fIsValid);
copyFields(key);
if (fUseHeap) {
key.fHeapData = NULL; // ownership transfer
}
// Consistency Checking
// To avoid the overhead of copying or ref-counting the dynamically
// allocated portion of the key, we use ownership transfer
// Key usability is only tracked in debug builds.
GR_DEBUGCODE(key.fIsValid = false;)
}
void deepCopyFrom(const GrBinHashKey<Entry, StackSize>& key) {
GrAssert(key.fIsValid);
copyFields(key);
if (fUseHeap) {
fHeapData = reinterpret_cast<uint8_t*>(
GrMalloc(sizeof(uint8_t) * fPhysicalSize));
memcpy(fHeapData, key.fHeapData, fLength);
}
}
virtual ~GrBinHashKey() {
if (fUseHeap) {
GrFree(fHeapData);
}
}
bool doPass() {
GrAssert(fIsValid);
if (0 == fPass) {
fPass++;
return true;
}
if (1 == fPass) {
bool passNeeded = false;
if (fLength > fPhysicalSize) {
// If the first pass ran out of space the we need to
// re-allocate and perform a second pass
GrFree(fHeapData);
fHeapData = reinterpret_cast<uint8_t*>(
GrMalloc(sizeof(uint8_t) * fLength));
fPhysicalSize = fLength;
fUseHeap = true;
passNeeded = true;
fLength = 0;
}
fPass++;
return passNeeded;
}
return false;
}
void keyData(const uint32_t *dataToAdd, size_t len) {
GrAssert(fIsValid);
GrAssert(fPass);
GrAssert(GrIsALIGN4(len));
if (fUseHeap) {
GrAssert(fHeapData);
GrAssert(fLength + len <= fPhysicalSize);
memcpy(&fHeapData[fLength], dataToAdd, len );
} else {
if (fLength + len <= StackSize) {
memcpy(&fStackData[fLength], dataToAdd, len);
} else {
GrAssert(1 == fPass);
}
}
fLength += len;
if (1 == fPass) {
uint32_t a = fA;
while (len >= 4) {
a += *dataToAdd++;
a += (a << 10);
a ^= (a >> 6);
len -= 4;
}
a += (a << 3);
a ^= (a >> 11);
a += (a << 15);
fA = a;
}
}
int compare(const GrBinHashKey<Entry, StackSize>& key) const {
GrAssert(fIsValid);
if (fLength == key.fLength) {
GrAssert(fUseHeap == key.fUseHeap);
if(fUseHeap) {
return memcmp(fHeapData, key.fHeapData, fLength);
} else {
return memcmp(fStackData, key.fStackData, fLength);
}
}
return (fLength - key.fLength);
}
static bool
EQ(const Entry& entry, const GrBinHashKey<Entry, StackSize>& key) {
GrAssert(key.fIsValid);
return 0 == entry.compare(key);
}
static bool
LT(const Entry& entry, const GrBinHashKey<Entry, StackSize>& key) {
GrAssert(key.fIsValid);
return entry.compare(key) < 0;
}
uint32_t getHash() const {
GrAssert(fIsValid);
return fA;
}
private:
void copyFields(const GrBinHashKey<Entry, StackSize>& src) {
if (fUseHeap) {
GrFree(fHeapData);
}
// We do a field-by-field copy because this is a non-POD
// class, and therefore memcpy would be bad
fA = src.fA;
fLength = src.fLength;
memcpy(fStackData, src.fStackData, StackSize);
fHeapData = src.fHeapData;
fPhysicalSize = src.fPhysicalSize;
fUseHeap = src.fUseHeap;
fPass = src.fPass;
}
uint32_t fA;
// For accumulating the variable length binary key
size_t fLength; // length of data accumulated so far
uint8_t fStackData[StackSize]; //Buffer for key storage
uint8_t* fHeapData; //Dynamically allocated extended key storage
size_t fPhysicalSize; //Total size available for key storage
bool fUseHeap; //Using a dynamically allocated key storage
int fPass; //Key generation pass counter
#if GR_DEBUG
public:
bool fIsValid;
#endif
};
#endif

View File

@ -0,0 +1,357 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrBufferAllocPool_DEFINED
#define GrBufferAllocPool_DEFINED
#include "GrNoncopyable.h"
#include "GrTDArray.h"
#include "GrTArray.h"
#include "GrMemory.h"
class GrGeometryBuffer;
class GrGpu;
/**
* A pool of geometry buffers tied to a GrGpu.
*
* The pool allows a client to make space for geometry and then put back excess
* space if it over allocated. When a client is ready to draw from the pool
* it calls unlock on the pool ensure buffers are ready for drawing. The pool
* can be reset after drawing is completed to recycle space.
*
* At creation time a minimum per-buffer size can be specified. Additionally,
* a number of buffers to preallocate can be specified. These will
* be allocated at the min size and kept around until the pool is destroyed.
*/
class GrBufferAllocPool : GrNoncopyable {
public:
/**
* Ensures all buffers are unlocked and have all data written to them.
* Call before drawing using buffers from the pool.
*/
void unlock();
/**
* Invalidates all the data in the pool, unrefs non-preallocated buffers.
*/
void reset();
/**
* Gets the number of preallocated buffers that are yet to be used.
*/
int preallocatedBuffersRemaining() const;
/**
* gets the number of preallocated buffers
*/
int preallocatedBufferCount() const;
/**
* Frees data from makeSpaces in LIFO order.
*/
void putBack(size_t bytes);
/**
* Gets the GrGpu that this pool is associated with.
*/
GrGpu* getGpu() { return fGpu; }
protected:
/**
* Used to determine what type of buffers to create. We could make the
* createBuffer a virtual except that we want to use it in the cons for
* pre-allocated buffers.
*/
enum BufferType {
kVertex_BufferType,
kIndex_BufferType,
};
/**
* Constructor
*
* @param gpu The GrGpu used to create the buffers.
* @param bufferType The type of buffers to create.
* @param frequentResetHint A hint that indicates that the pool
* should expect frequent unlock() calls
* (as opposed to many makeSpace / acquires
* between resets).
* @param bufferSize The minimum size of created buffers.
* This value will be clamped to some
* reasonable minimum.
* @param preallocBufferCnt The pool will allocate this number of
* buffers at bufferSize and keep them until it
* is destroyed.
*/
GrBufferAllocPool(GrGpu* gpu,
BufferType bufferType,
bool frequentResetHint,
size_t bufferSize = 0,
int preallocBufferCnt = 0);
virtual ~GrBufferAllocPool();
/**
* Gets the size of the preallocated buffers.
*
* @return the size of preallocated buffers.
*/
size_t preallocatedBufferSize() const {
return fPreallocBuffers.count() ? fMinBlockSize : 0;
}
/**
* Returns a block of memory to hold data. A buffer designated to hold the
* data is given to the caller. The buffer may or may not be locked. The
* returned ptr remains valid until any of the following:
* *makeSpace is called again.
* *unlock is called.
* *reset is called.
* *this object is destroyed.
*
* Once unlock on the pool is called the data is guaranteed to be in the
* buffer at the offset indicated by offset. Until that time it may be
* in temporary storage and/or the buffer may be locked.
*
* @param size the amount of data to make space for
* @param alignment alignment constraint from start of buffer
* @param buffer returns the buffer that will hold the data.
* @param offset returns the offset into buffer of the data.
* @return pointer to where the client should write the data.
*/
void* makeSpace(size_t size,
size_t alignment,
const GrGeometryBuffer** buffer,
size_t* offset);
/**
* Gets the number of items of a size that can be added to the current
* buffer without spilling to another buffer. If the pool has been reset, or
* the previous makeSpace completely exhausted a buffer then the returned
* size will be the size of the next available preallocated buffer, or zero
* if no preallocated buffer remains available. It is assumed that items
* should be itemSize-aligned from the start of a buffer.
*
* @return the number of items that would fit in the current buffer.
*/
int currentBufferItems(size_t itemSize) const;
GrGeometryBuffer* createBuffer(size_t size);
private:
// The GrGpu must be able to clear the ref of pools it creates as members
friend class GrGpu;
void releaseGpuRef();
struct BufferBlock {
size_t fBytesFree;
GrGeometryBuffer* fBuffer;
};
bool createBlock(size_t requestSize);
void destroyBlock();
void flushCpuData(GrGeometryBuffer* buffer, size_t flushSize);
#if GR_DEBUG
void validate(bool unusedBlockAllowed = false) const;
#endif
size_t fBytesInUse;
GrGpu* fGpu;
bool fGpuIsReffed;
bool fFrequentResetHint;
GrTDArray<GrGeometryBuffer*> fPreallocBuffers;
size_t fMinBlockSize;
BufferType fBufferType;
GrTArray<BufferBlock> fBlocks;
int fPreallocBuffersInUse;
int fFirstPreallocBuffer;
GrAutoMalloc fCpuData;
void* fBufferPtr;
};
class GrVertexBuffer;
/**
* A GrBufferAllocPool of vertex buffers
*/
class GrVertexBufferAllocPool : public GrBufferAllocPool {
public:
/**
* Constructor
*
* @param gpu The GrGpu used to create the vertex buffers.
* @param frequentResetHint A hint that indicates that the pool
* should expect frequent unlock() calls
* (as opposed to many makeSpace / acquires
* between resets).
* @param bufferSize The minimum size of created VBs This value
* will be clamped to some reasonable minimum.
* @param preallocBufferCnt The pool will allocate this number of VBs at
* bufferSize and keep them until it is
* destroyed.
*/
GrVertexBufferAllocPool(GrGpu* gpu,
bool frequentResetHint,
size_t bufferSize = 0,
int preallocBufferCnt = 0);
/**
* Returns a block of memory to hold vertices. A buffer designated to hold
* the vertices given to the caller. The buffer may or may not be locked.
* The returned ptr remains valid until any of the following:
* *makeSpace is called again.
* *unlock is called.
* *reset is called.
* *this object is destroyed.
*
* Once unlock on the pool is called the vertices are guaranteed to be in
* the buffer at the offset indicated by startVertex. Until that time they
* may be in temporary storage and/or the buffer may be locked.
*
* @param layout specifies type of vertices to allocate space for
* @param vertexCount number of vertices to allocate space for
* @param buffer returns the vertex buffer that will hold the
* vertices.
* @param startVertex returns the offset into buffer of the first vertex.
* In units of the size of a vertex from layout param.
* @return pointer to first vertex.
*/
void* makeSpace(GrVertexLayout layout,
int vertexCount,
const GrVertexBuffer** buffer,
int* startVertex);
/**
* Shortcut to make space and then write verts into the made space.
*/
bool appendVertices(GrVertexLayout layout,
int vertexCount,
const void* vertices,
const GrVertexBuffer** buffer,
int* startVertex);
/**
* Gets the number of vertices that can be added to the current VB without
* spilling to another VB. If the pool has been reset, or the previous
* makeSpace completely exhausted a VB then the returned number of vertices
* would fit in the next available preallocated buffer. If any makeSpace
* would force a new VB to be created the return value will be zero.
*
* @param the format of vertices to compute space for.
* @return the number of vertices that would fit in the current buffer.
*/
int currentBufferVertices(GrVertexLayout layout) const;
/**
* Gets the number of vertices that can fit in a preallocated vertex buffer.
* Zero if no preallocated buffers.
*
* @param the format of vertices to compute space for.
*
* @return number of vertices that fit in one of the preallocated vertex
* buffers.
*/
int preallocatedBufferVertices(GrVertexLayout layout) const;
private:
typedef GrBufferAllocPool INHERITED;
};
class GrIndexBuffer;
/**
* A GrBufferAllocPool of index buffers
*/
class GrIndexBufferAllocPool : public GrBufferAllocPool {
public:
/**
* Constructor
*
* @param gpu The GrGpu used to create the index buffers.
* @param frequentResetHint A hint that indicates that the pool
* should expect frequent unlock() calls
* (as opposed to many makeSpace / acquires
* between resets).
* @param bufferSize The minimum size of created IBs This value
* will be clamped to some reasonable minimum.
* @param preallocBufferCnt The pool will allocate this number of VBs at
* bufferSize and keep them until it is
* destroyed.
*/
GrIndexBufferAllocPool(GrGpu* gpu,
bool frequentResetHint,
size_t bufferSize = 0,
int preallocBufferCnt = 0);
/**
* Returns a block of memory to hold indices. A buffer designated to hold
* the indices is given to the caller. The buffer may or may not be locked.
* The returned ptr remains valid until any of the following:
* *makeSpace is called again.
* *unlock is called.
* *reset is called.
* *this object is destroyed.
*
* Once unlock on the pool is called the indices are guaranteed to be in the
* buffer at the offset indicated by startIndex. Until that time they may be
* in temporary storage and/or the buffer may be locked.
*
* @param indexCount number of indices to allocate space for
* @param buffer returns the index buffer that will hold the indices.
* @param startIndex returns the offset into buffer of the first index.
* @return pointer to first index.
*/
void* makeSpace(int indexCount,
const GrIndexBuffer** buffer,
int* startIndex);
/**
* Shortcut to make space and then write indices into the made space.
*/
bool appendIndices(int indexCount,
const void* indices,
const GrIndexBuffer** buffer,
int* startIndex);
/**
* Gets the number of indices that can be added to the current IB without
* spilling to another IB. If the pool has been reset, or the previous
* makeSpace completely exhausted a IB then the returned number of indices
* would fit in the next available preallocated buffer. If any makeSpace
* would force a new IB to be created the return value will be zero.
*/
int currentBufferIndices() const;
/**
* Gets the number of indices that can fit in a preallocated index buffer.
* Zero if no preallocated buffers.
*
* @return number of indices that fit in one of the preallocated index
* buffers.
*/
int preallocatedBufferIndices() const;
private:
typedef GrBufferAllocPool INHERITED;
};
#endif

View File

@ -0,0 +1,148 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrClip_DEFINED
#define GrClip_DEFINED
#include "GrClipIterator.h"
#include "GrRect.h"
#include "GrPath.h"
#include "GrTArray.h"
#include "GrTemplates.h"
class GrClip {
public:
GrClip();
GrClip(const GrClip& src);
/**
* If specified, the conservativeBounds parameter already takes (tx,ty)
* into account.
*/
GrClip(GrClipIterator* iter, GrScalar tx, GrScalar ty,
const GrRect* conservativeBounds = NULL);
GrClip(const GrIRect& rect);
GrClip(const GrRect& rect);
~GrClip();
GrClip& operator=(const GrClip& src);
bool hasConservativeBounds() const { return fConservativeBoundsValid; }
const GrRect& getConservativeBounds() const { return fConservativeBounds; }
int getElementCount() const { return fList.count(); }
GrClipType getElementType(int i) const { return fList[i].fType; }
const GrPath& getPath(int i) const {
GrAssert(kPath_ClipType == fList[i].fType);
return fList[i].fPath;
}
GrPathFill getPathFill(int i) const {
GrAssert(kPath_ClipType == fList[i].fType);
return fList[i].fPathFill;
}
const GrRect& getRect(int i) const {
GrAssert(kRect_ClipType == fList[i].fType);
return fList[i].fRect;
}
GrSetOp getOp(int i) const { return fList[i].fOp; }
bool isRect() const {
if (1 == fList.count() && kRect_ClipType == fList[0].fType) {
// if we determined that the clip is a single rect
// we ought to have also used that rect as the bounds.
GrAssert(fConservativeBoundsValid);
GrAssert(fConservativeBounds == fList[0].fRect);
return true;
} else {
return false;
}
}
bool isEmpty() const { return 0 == fList.count(); }
/**
* Resets this clip to be empty
*/
void setEmpty();
/**
* If specified, the bounds parameter already takes (tx,ty) into account.
*/
void setFromIterator(GrClipIterator* iter, GrScalar tx, GrScalar ty,
const GrRect* conservativeBounds = NULL);
void setFromRect(const GrRect& rect);
void setFromIRect(const GrIRect& rect);
friend bool operator==(const GrClip& a, const GrClip& b) {
if (a.fList.count() != b.fList.count()) {
return false;
}
int count = a.fList.count();
for (int i = 0; i < count; ++i) {
if (a.fList[i] != b.fList[i]) {
return false;
}
}
return true;
}
friend bool operator!=(const GrClip& a, const GrClip& b) {
return !(a == b);
}
private:
struct Element {
GrClipType fType;
GrRect fRect;
GrPath fPath;
GrPathFill fPathFill;
GrSetOp fOp;
bool operator ==(const Element& e) const {
if (e.fType != fType || e.fOp != fOp) {
return false;
}
switch (fType) {
case kRect_ClipType:
return fRect == e.fRect;
break;
case kPath_ClipType:
return fPath == e.fPath;
default:
GrCrash("Unknown clip element type.");
return false; // suppress warning
}
}
bool operator !=(const Element& e) const { return !(*this == e); }
};
GrRect fConservativeBounds;
bool fConservativeBoundsValid;
enum {
kPreAllocElements = 4,
};
GrAlignedSTStorage<kPreAllocElements, Element> fListStorage;
GrTArray<Element> fList;
};
#endif

View File

@ -0,0 +1,87 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrClipIterator_DEFINED
#define GrClipIterator_DEFINED
#include "GrPath.h"
#include "GrRect.h"
/**
* A clip is a list of paths and/or rects with set operations to combine them.
*/
class GrClipIterator {
public:
virtual ~GrClipIterator() {}
/**
* Returns true if there are no more rects to process
*/
virtual bool isDone() const = 0;
/**
* Rewind the iterator to replay the set of clip elements again
*/
virtual void rewind() = 0;
/**
* Get the type of the current clip element
*/
virtual GrClipType getType() const = 0;
/**
* Return the current path. It is an error to call this when isDone() is
* true or when getType() is kRect_Type.
*/
virtual const GrPath* getPath() = 0;
/**
* Return the fill rule for the path. It is an error to call this when
* isDone() is true or when getType is kRect_Type.
*/
virtual GrPathFill getPathFill() const = 0;
/**
* Return the current rect. It is an error to call this when isDone is true
* or when getType() is kPath_Type.
*/
virtual void getRect(GrRect* rect) const = 0;
/**
* Gets the operation used to apply the current item to previously iterated
* items. Iterators should not produce a Replace op.
*/
virtual GrSetOp getOp() const = 0;
/**
* Call to move to the next element in the list, previous path iter can be
* made invalid.
*/
virtual void next() = 0;
};
/**
* Call to rewind iter, first checking to see if iter is NULL
*/
static inline void GrSafeRewind(GrClipIterator* iter) {
if (iter) {
iter->rewind();
}
}
#endif

View File

@ -0,0 +1,72 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrColor_DEFINED
#define GrColor_DEFINED
#include "GrTypes.h"
/**
* GrColor is 4 bytes for R, G, B, A, in a compile-time specific order. The
* components are stored premultiplied.
*/
typedef uint32_t GrColor;
// indices for address a GrColor as an array of bytes
#define GrColor_INDEX_R 0
#define GrColor_INDEX_G 1
#define GrColor_INDEX_B 2
#define GrColor_INDEX_A 3
// shfit amount to assign a component to a GrColor int
#define GrColor_SHIFT_R 0
#define GrColor_SHIFT_G 8
#define GrColor_SHIFT_B 16
#define GrColor_SHIFT_A 24
/**
* Pack 4 components (RGBA) into a GrColor int
*/
static inline GrColor GrColorPackRGBA(unsigned r, unsigned g,
unsigned b, unsigned a) {
GrAssert((uint8_t)r == r);
GrAssert((uint8_t)g == g);
GrAssert((uint8_t)b == b);
GrAssert((uint8_t)a == a);
return (r << GrColor_SHIFT_R) |
(g << GrColor_SHIFT_G) |
(b << GrColor_SHIFT_B) |
(a << GrColor_SHIFT_A);
}
// extract a component (byte) from a GrColor int
#define GrColorUnpackR(color) (((color) >> GrColor_SHIFT_R) & 0xFF)
#define GrColorUnpackG(color) (((color) >> GrColor_SHIFT_G) & 0xFF)
#define GrColorUnpackB(color) (((color) >> GrColor_SHIFT_B) & 0xFF)
#define GrColorUnpackA(color) (((color) >> GrColor_SHIFT_A) & 0xFF)
/**
* Since premultiplied means that alpha >= color, we construct a color with
* each component==255 and alpha == 0 to be "illegal"
*/
#define GrColor_ILLEGAL (~(0xFF << GrColor_SHIFT_A))
#endif

View File

@ -0,0 +1,456 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrConfig_DEFINED
#define GrConfig_DEFINED
///////////////////////////////////////////////////////////////////////////////
// preconfig section:
//
// All the work before including GrUserConfig.h should center around guessing
// what platform we're on, and defining low-level symbols based on that.
//
// A build environment may have already defined symbols, so we first check
// for that
//
// hack to ensure we know what sort of Apple platform we're on
#if defined(__APPLE_CPP__) || defined(__APPLE_CC__)
#include <TargetConditionals.h>
#endif
/**
* Gr defines are set to 0 or 1, rather than being undefined or defined
*/
#if !defined(GR_ANDROID_BUILD)
#define GR_ANDROID_BUILD 0
#endif
#if !defined(GR_IOS_BUILD)
#define GR_IOS_BUILD 0
#endif
#if !defined(GR_LINUX_BUILD)
#define GR_LINUX_BUILD 0
#endif
#if !defined(GR_MAC_BUILD)
#define GR_MAC_BUILD 0
#endif
#if !defined(GR_WIN32_BUILD)
#define GR_WIN32_BUILD 0
#endif
#if !defined(GR_QNX_BUILD)
#define GR_QNX_BUILD 0
#endif
/**
* If no build target has been defined, attempt to infer.
*/
#if !GR_ANDROID_BUILD && !GR_IOS_BUILD && !GR_LINUX_BUILD && !GR_MAC_BUILD && !GR_WIN32_BUILD && !GR_QNX_BUILD
#if defined(_WIN32)
#undef GR_WIN32_BUILD
#define GR_WIN32_BUILD 1
// #error "WIN"
#elif TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
#undef GR_IOS_BUILD
#define GR_IOS_BUILD 1
// #error "IOS"
#elif (defined(ANDROID_NDK) && ANDROID_NDK) || defined(ANDROID)
#undef GR_ANDROID_BUILD
#define GR_ANDROID_BUILD 1
// #error "ANDROID"
#elif TARGET_OS_MAC
#undef GR_MAC_BUILD
#define GR_MAC_BUILD 1
// #error "MAC"
#elif TARGET_OS_QNX || defined(__QNXNTO__)
#undef GR_QNX_BUILD
#define GR_QNX_BUILD 1
// #error "QNX"
#else
#undef GR_LINUX_BUILD
#define GR_LINUX_BUILD 1
// #error "LINUX"
#endif
#endif
// we need both GR_DEBUG and GR_RELEASE to be defined as 0 or 1
//
#ifndef GR_DEBUG
#ifdef GR_RELEASE
#define GR_DEBUG !GR_RELEASE
#else
#ifdef NDEBUG
#define GR_DEBUG 0
#else
#define GR_DEBUG 1
#endif
#endif
#endif
#ifndef GR_RELEASE
#define GR_RELEASE !GR_DEBUG
#endif
#if GR_DEBUG == GR_RELEASE
#error "GR_DEBUG and GR_RELEASE must not be the same"
#endif
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#if GR_WIN32_BUILD
// VC8 doesn't support stdint.h, so we define those types here.
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef short int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
typedef unsigned uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
/*
* Include stdint.h with defines that trigger declaration of C99 limit/const
* macros here before anyone else has a chance to include stdint.h without
* these.
*/
#define __STDC_LIMIT_MACROS
#define __STDC_CONSTANT_MACROS
#include <stdint.h>
#endif
/*
* The "user config" file can be empty, and everything should work. It is
* meant to store a given platform/client's overrides of our guess-work.
*
* A alternate user config file can be specified by defining
* GR_USER_CONFIG_FILE. It should be defined relative to GrConfig.h
*
* e.g. it can specify GR_DEBUG/GR_RELEASE as it please, change the BUILD
* target, or supply its own defines for anything else (e.g. GR_SCALAR)
*/
#if !defined(GR_USER_CONFIG_FILE)
#include "GrUserConfig.h"
#else
#include GR_USER_CONFIG_FILE
#endif
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// postconfig section:
//
// GR_IMPLEMENTATION should be define to 1 when building Gr and 0 when including
// it in another dependent build. The Gr makefile/ide-project should define this
// to 1.
#if !defined(GR_IMPLEMENTATION)
#define GR_IMPLEMENTATION 0
#endif
// If Gr is built as a shared library then GR_DLL should be defined to 1 (both
// when building Gr and when including its headers in dependent builds). Only
// currently supported minimally for Chrome's Win32 Multi-DLL build (TODO:
// correctly exort all of the public API correctly and support shared lib on
// other platforms).
#if !defined(GR_DLL)
#define GR_DLL 0
#endif
#if defined(WIN32) && defined(SKIA_DLL)
#if GR_IMPLEMENTATION
#if defined(__GNUC__)
#define GR_API __attribute__((dllexport))
#else
#define GR_API __declspec(dllexport)
#endif
#else
#if defined(__GNUC__)
#define GR_API __attribute__((dllimport))
#else
#define GR_API __declspec(dllimport)
#endif
#endif
#elif __GNUC__ >= 4
#if GR_IMPLEMENTATION
#define GR_API __attribute__((visibility("default")))
#else
#define GR_API
#endif
#else
#define GR_API
#endif
// By now we must have a GR_..._BUILD symbol set to 1, and a decision about
// debug -vs- release
//
extern GR_API void GrPrintf(const char format[], ...);
/**
* GR_STRING makes a string of X where X is expanded before conversion to a string
* if X itself contains macros.
*/
#define GR_STRING(X) GR_STRING_IMPL(X)
#define GR_STRING_IMPL(X) #X
/**
* GR_CONCAT concatenates X and Y where each is expanded before
* contanenation if either contains macros.
*/
#define GR_CONCAT(X,Y) GR_CONCAT_IMPL(X,Y)
#define GR_CONCAT_IMPL(X,Y) X##Y
/**
* Creates a string of the form "<filename>(<linenumber>) : "
*/
#define GR_FILE_AND_LINE_STR __FILE__ "(" GR_STRING(__LINE__) ") : "
/**
* Compilers have different ways of issuing warnings. This macro
* attempts to abstract them, but may need to be specialized for your
* particular compiler.
* To insert compiler warnings use "#pragma message GR_WARN(<string>)"
*/
#if defined(_MSC_VER) && _MSC_VER
#define GR_WARN(MSG) (GR_FILE_AND_LINE_STR "WARNING: " MSG)
#else//__GNUC__ - may need other defines for different compilers
#define GR_WARN(MSG) ("WARNING: " MSG)
#endif
/**
* GR_ALWAYSBREAK is an unconditional break in all builds.
*/
#if !defined(GR_ALWAYSBREAK)
#if GR_WIN32_BUILD
#define GR_ALWAYSBREAK __debugbreak()
#else
// TODO: do other platforms really not have continuable breakpoints?
// sign extend for 64bit architectures to be sure this is
// in the high address range
#define GR_ALWAYSBREAK *((int*)(int64_t)(int32_t)0xbeefcafe) = 0;
#endif
#endif
/**
* GR_DEBUGBREAK is an unconditional break in debug builds.
*/
#if !defined(GR_DEBUGBREAK)
#if GR_DEBUG
#define GR_DEBUGBREAK GR_ALWAYSBREAK
#else
#define GR_DEBUGBREAK
#endif
#endif
/**
* GR_ALWAYSASSERT is an assertion in all builds.
*/
#if !defined(GR_ALWAYSASSERT)
#define GR_ALWAYSASSERT(COND) \
do { \
if (!(COND)) { \
GrPrintf("%s %s failed\n", GR_FILE_AND_LINE_STR, #COND); \
GR_ALWAYSBREAK; \
} \
} while (false)
#endif
/**
* GR_DEBUGASSERT is an assertion in debug builds only.
*/
#if !defined(GR_DEBUGASSERT)
#if GR_DEBUG
#define GR_DEBUGASSERT(COND) GR_ALWAYSASSERT(COND)
#else
#define GR_DEBUGASSERT(COND)
#endif
#endif
/**
* Prettier forms of the above macros.
*/
#define GrAssert(COND) GR_DEBUGASSERT(COND)
#define GrAlwaysAssert(COND) GR_ALWAYSASSERT(COND)
/**
* Crash from unrecoverable condition, optionally with a message.
*/
inline void GrCrash() { GrAlwaysAssert(false); }
inline void GrCrash(const char* msg) { GrPrintf(msg); GrAlwaysAssert(false); }
/**
* GR_DEBUGCODE compiles the code X in debug builds only
*/
#if !defined(GR_DEBUGCODE)
#if GR_DEBUG
#define GR_DEBUGCODE(X) X
#else
#define GR_DEBUGCODE(X)
#endif
#endif
/**
* GR_STATIC_ASSERT is a compile time assertion. Depending on the platform
* it may print the message in the compiler log. Obviously, the condition must
* be evaluatable at compile time.
*/
// VS 2010 and GCC compiled with c++0x or gnu++0x support the new
// static_assert.
#if !defined(GR_STATIC_ASSERT)
#if (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)
#define GR_STATIC_ASSERT(CONDITION) static_assert(CONDITION, "bug")
#else
template <bool> class GR_STATIC_ASSERT_FAILURE;
template <> class GR_STATIC_ASSERT_FAILURE<true> {};
#define GR_STATIC_ASSERT(CONDITION) \
enum {GR_CONCAT(X,__LINE__) = \
sizeof(GR_STATIC_ASSERT_FAILURE<CONDITION>)}
#endif
#endif
#if !defined(GR_SCALAR_IS_FLOAT)
#define GR_SCALAR_IS_FLOAT 0
#endif
#if !defined(GR_SCALAR_IS_FIXED)
#define GR_SCALAR_IS_FIXED 0
#endif
#if !defined(GR_TEXT_SCALAR_TYPE_IS_USHORT)
#define GR_TEXT_SCALAR_TYPE_IS_USHORT 0
#endif
#if !defined(GR_TEXT_SCALAR_TYPE_IS_FLOAT)
#define GR_TEXT_SCALAR_TYPE_IS_FLOAT 0
#endif
#if !defined(GR_TEXT_SCALAR_TYPE_IS_FIXED)
#define GR_TEXT_SCALAR_TYPE_IS_FIXED 0
#endif
#ifndef GR_DUMP_TEXTURE_UPLOAD
#define GR_DUMP_TEXTURE_UPLOAD 0
#endif
/**
* GR_COLLECT_STATS controls whether the GrGpu class collects stats.
* If not already defined then collect in debug build but not release.
*/
#if !defined(GR_COLLECT_STATS)
#define GR_COLLECT_STATS GR_DEBUG
#endif
/**
* GR_STATIC_RECT_VB controls whether rects are drawn by issuing a vertex
* for each corner or using a static vb that is positioned by modifying the
* view / texture matrix.
*/
#if !defined(GR_STATIC_RECT_VB)
#define GR_STATIC_RECT_VB 1
#endif
/**
* GR_AGGRESSIVE_SHADER_OPTS controls how aggressively shaders are optimized
* for special cases. On systems where program changes are expensive this
* may not be advantageous. Consecutive draws may no longer use the same
* program.
*/
#if !defined(GR_AGGRESSIVE_SHADER_OPTS)
#define GR_AGGRESSIVE_SHADER_OPTS 1
#endif
/**
* GR_GEOM_BUFFER_LOCK_THRESHOLD gives a threshold (in bytes) for when Gr should
* lock a GrGeometryBuffer to update its contents. It will use Lock() if the
* size of the udpated region is greater than the threshold. Otherwise it will
* use updateData() or updateSubData().
*/
#if !defined(GR_GEOM_BUFFER_LOCK_THRESHOLD)
#define GR_GEOM_BUFFER_LOCK_THRESHOLD (1 << 15)
#endif
/**
* Enables/disables use of offscreen AA
*/
#if !defined(GR_USE_OFFSCREEN_AA)
#define GR_USE_OFFSCREEN_AA 0
#endif
/**
* GR_MAX_OFFSCREEN_AA_SIZE controls the size at which offscreen AA will tile.
* Tiling saves GPU memory by limiting the size of the offscreen buffer. The
* max offscreen may be as large as (4*GR_MAX_OFFSCREEN_AA_SIZE)^2 pixels.
*/
#if !defined(GR_MAX_OFFSCREEN_AA_SIZE)
#define GR_MAX_OFFSCREEN_AA_SIZE 256
#endif
///////////////////////////////////////////////////////////////////////////////
// tail section:
//
// Now we just assert if we are missing some required define, or if we detect
// and inconsistent combination of defines
//
/**
* Only one build target macro should be 1 and the rest should be 0.
*/
#define GR_BUILD_SUM (GR_WIN32_BUILD + GR_MAC_BUILD + GR_IOS_BUILD + GR_ANDROID_BUILD + GR_LINUX_BUILD + GR_QNX_BUILD)
#if 0 == GR_BUILD_SUM
#error "Missing a GR_BUILD define"
#elif 1 != GR_BUILD_SUM
#error "More than one GR_BUILD defined"
#endif
#if !GR_SCALAR_IS_FLOAT && !GR_SCALAR_IS_FIXED
#undef GR_SCALAR_IS_FLOAT
#define GR_SCALAR_IS_FLOAT 1
#pragma message GR_WARN("Scalar type not defined, defaulting to float")
#endif
#if !GR_TEXT_SCALAR_IS_FLOAT && \
!GR_TEXT_SCALAR_IS_FIXED && \
!GR_TEXT_SCALAR_IS_USHORT
#undef GR_TEXT_SCALAR_IS_FLOAT
#define GR_TEXT_SCALAR_IS_FLOAT 1
#pragma message GR_WARN("Text scalar type not defined, defaulting to float")
#endif
#if 0
#if GR_WIN32_BUILD
// #pragma message GR_WARN("GR_WIN32_BUILD")
#endif
#if GR_MAC_BUILD
// #pragma message GR_WARN("GR_MAC_BUILD")
#endif
#if GR_IOS_BUILD
// #pragma message GR_WARN("GR_IOS_BUILD")
#endif
#if GR_ANDROID_BUILD
// #pragma message GR_WARN("GR_ANDROID_BUILD")
#endif
#if GR_LINUX_BUILD
// #pragma message GR_WARN("GR_LINUX_BUILD")
#endif
#if GR_QNX_BUILD
// #pragma message GR_WARN("GR_QNX_BUILD")
#endif
#endif
#endif

View File

@ -0,0 +1,654 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrContext_DEFINED
#define GrContext_DEFINED
#include "GrClip.h"
#include "GrTextureCache.h"
#include "GrPaint.h"
#include "GrPathRenderer.h"
class GrFontCache;
class GrGpu;
struct GrGpuStats;
class GrVertexBufferAllocPool;
class GrIndexBufferAllocPool;
class GrInOrderDrawBuffer;
class GR_API GrContext : public GrRefCnt {
public:
/**
* Creates a GrContext from within a 3D context.
*/
static GrContext* Create(GrEngine engine,
GrPlatform3DContext context3D);
/**
* Helper to create a opengl-shader based context
*/
static GrContext* CreateGLShaderContext();
virtual ~GrContext();
/**
* The GrContext normally assumes that no outsider is setting state
* within the underlying 3D API's context/device/whatever. This call informs
* the context that the state was modified and it should resend. Shouldn't
* be called frequently for good performance.
*/
void resetContext();
/**
* Abandons all gpu resources, assumes 3D API state is unknown. Call this
* if you have lost the associated GPU context, and thus internal texture,
* buffer, etc. references/IDs are now invalid. Should be called even when
* GrContext is no longer going to be used for two reasons:
* 1) ~GrContext will not try to free the objects in the 3D API.
* 2) If you've created GrResources that outlive the GrContext they will
* be marked as invalid (GrResource::isValid()) and won't attempt to
* free their underlying resource in the 3D API.
* Content drawn since the last GrContext::flush() may be lost.
*/
void contextLost();
/**
* Similar to contextLost, but makes no attempt to reset state.
* Use this method when GrContext destruction is pending, but
* the graphics context is destroyed first.
*/
void contextDestroyed();
/**
* Frees gpu created by the context. Can be called to reduce GPU memory
* pressure.
*/
void freeGpuResources();
///////////////////////////////////////////////////////////////////////////
// Textures
/**
* Search for an entry with the same Key. If found, "lock" it and return it.
* If not found, return null.
*/
GrTextureEntry* findAndLockTexture(GrTextureKey*,
const GrSamplerState&);
/**
* Create a new entry, based on the specified key and texture, and return
* its "locked" entry.
*
* Ownership of the texture is transferred to the Entry, which will unref()
* it when we are purged or deleted.
*/
GrTextureEntry* createAndLockTexture(GrTextureKey* key,
const GrSamplerState&,
const GrTextureDesc&,
void* srcData, size_t rowBytes);
/**
* Returns a texture matching the desc. It's contents are unknown. Subsequent
* requests with the same descriptor are not guaranteed to return the same
* texture. The same texture is guaranteed not be returned again until it is
* unlocked.
*
* Textures created by createAndLockTexture() hide the complications of
* tiling non-power-of-two textures on APIs that don't support this (e.g.
* unextended GLES2). Tiling a npot texture created by lockKeylessTexture on
* such an API will create gaps in the tiling pattern. This includes clamp
* mode. (This may be addressed in a future update.)
*/
GrTextureEntry* lockKeylessTexture(const GrTextureDesc& desc);
/**
* Finds a texture that approximately matches the descriptor. Will be
* at least as large in width and height as desc specifies. If desc
* specifies that texture is a render target then result will be a
* render target. If desc specifies a render target and doesn't set the
* no stencil flag then result will have a stencil. Format and aa level
* will always match.
*/
GrTextureEntry* findApproximateKeylessTexture(const GrTextureDesc& desc);
/**
* When done with an entry, call unlockTexture(entry) on it, which returns
* it to the cache, where it may be purged.
*/
void unlockTexture(GrTextureEntry* entry);
/**
* Creates a texture that is outside the cache. Does not count against
* cache's budget.
*/
GrTexture* createUncachedTexture(const GrTextureDesc&,
void* srcData,
size_t rowBytes);
/**
* Returns true if the specified use of an indexed texture is supported.
*/
bool supportsIndex8PixelConfig(const GrSamplerState&, int width, int height);
/**
* Return the current texture cache limits.
*
* @param maxTextures If non-null, returns maximum number of textures that
* can be held in the cache.
* @param maxTextureBytes If non-null, returns maximum number of bytes of
* texture memory that can be held in the cache.
*/
void getTextureCacheLimits(int* maxTextures, size_t* maxTextureBytes) const;
/**
* Specify the texture cache limits. If the current cache exceeds either
* of these, it will be purged (LRU) to keep the cache within these limits.
*
* @param maxTextures The maximum number of textures that can be held in
* the cache.
* @param maxTextureBytes The maximum number of bytes of texture memory
* that can be held in the cache.
*/
void setTextureCacheLimits(int maxTextures, size_t maxTextureBytes);
/**
* Return the max width or height of a texture supported by the current gpu
*/
int getMaxTextureSize() const;
/**
* Return the max width or height of a render target supported by the
* current gpu
*/
int getMaxRenderTargetSize() const;
///////////////////////////////////////////////////////////////////////////
// Render targets
/**
* Sets the render target.
* @param target the render target to set. (should not be NULL.)
*/
void setRenderTarget(GrRenderTarget* target);
/**
* Gets the current render target.
* @return the currently bound render target. Should never be NULL.
*/
const GrRenderTarget* getRenderTarget() const;
GrRenderTarget* getRenderTarget();
///////////////////////////////////////////////////////////////////////////
// Platform Surfaces
// GrContext provides an interface for wrapping externally created textures
// and rendertargets in their Gr-equivalents.
/**
* Wraps an existing 3D API surface in a GrObject. desc.fFlags determines
* the type of object returned. If kIsTexture is set the returned object
* will be a GrTexture*. Otherwise, it will be a GrRenderTarget*. If both
* are set the render target object is accessible by
* GrTexture::asRenderTarget().
*
* GL: if the object is a texture Gr may change its GL texture parameters
* when it is drawn.
*
* @param desc description of the object to create.
* @return either a GrTexture* or GrRenderTarget* depending on desc. NULL
* on failure.
*/
GrResource* createPlatformSurface(const GrPlatformSurfaceDesc& desc);
/**
* Reads the current target object (e.g. FBO or IDirect3DSurface9*) and
* viewport state from the underlying 3D API and wraps it in a
* GrRenderTarget. The GrRenderTarget will not attempt to delete/destroy the
* underlying object in its destructor and it is up to caller to guarantee
* that it remains valid while the GrRenderTarget is used.
*
* Will not detect that the render target is also a texture. If you need
* to also use the render target as a GrTexture use createPlatformSurface.
*
* @return the newly created GrRenderTarget
*/
GrRenderTarget* createRenderTargetFrom3DApiState();
///////////////////////////////////////////////////////////////////////////
// Matrix state
/**
* Gets the current transformation matrix.
* @return the current matrix.
*/
const GrMatrix& getMatrix() const;
/**
* Sets the transformation matrix.
* @param m the matrix to set.
*/
void setMatrix(const GrMatrix& m);
/**
* Concats the current matrix. The passed matrix is applied before the
* current matrix.
* @param m the matrix to concat.
*/
void concatMatrix(const GrMatrix& m) const;
///////////////////////////////////////////////////////////////////////////
// Clip state
/**
* Gets the current clip.
* @return the current clip.
*/
const GrClip& getClip() const;
/**
* Sets the clip.
* @param clip the clip to set.
*/
void setClip(const GrClip& clip);
/**
* Convenience method for setting the clip to a rect.
* @param rect the rect to set as the new clip.
*/
void setClip(const GrIRect& rect);
///////////////////////////////////////////////////////////////////////////
// Draws
/**
* Clear the entire or rect of the render target, ignoring any clips.
* @param rect the rect to clear or the whole thing if rect is NULL.
* @param color the color to clear to.
*/
void clear(const GrIRect* rect, GrColor color);
/**
* Draw everywhere (respecting the clip) with the paint.
*/
void drawPaint(const GrPaint& paint);
/**
* Draw the rect using a paint.
* @param paint describes how to color pixels.
* @param strokeWidth If strokeWidth < 0, then the rect is filled, else
* the rect is mitered stroked based on strokeWidth. If
* strokeWidth == 0, then the stroke is always a single
* pixel thick.
* @param matrix Optional matrix applied to the rect. Applied before
* context's matrix or the paint's matrix.
* The rects coords are used to access the paint (through texture matrix)
*/
void drawRect(const GrPaint& paint,
const GrRect&,
GrScalar strokeWidth = -1,
const GrMatrix* matrix = NULL);
/**
* Maps a rect of paint coordinates onto the a rect of destination
* coordinates. Each rect can optionally be transformed. The srcRect
* is stretched over the dstRect. The dstRect is transformed by the
* context's matrix and the srcRect is transformed by the paint's matrix.
* Additional optional matrices can be provided by parameters.
*
* @param paint describes how to color pixels.
* @param dstRect the destination rect to draw.
* @param srcRect rect of paint coordinates to be mapped onto dstRect
* @param dstMatrix Optional matrix to transform dstRect. Applied before
* context's matrix.
* @param srcMatrix Optional matrix to transform srcRect Applied before
* paint's matrix.
*/
void drawRectToRect(const GrPaint& paint,
const GrRect& dstRect,
const GrRect& srcRect,
const GrMatrix* dstMatrix = NULL,
const GrMatrix* srcMatrix = NULL);
/**
* Draws a path.
*
* @param paint describes how to color pixels.
* @param path the path to draw
* @param fill the path filling rule to use.
* @param translate optional additional translation applied to the
* path.
*/
void drawPath(const GrPaint& paint, const GrPath& path, GrPathFill fill,
const GrPoint* translate = NULL);
/**
* Draws vertices with a paint.
*
* @param paint describes how to color pixels.
* @param primitiveType primitives type to draw.
* @param vertexCount number of vertices.
* @param positions array of vertex positions, required.
* @param texCoords optional array of texture coordinates used
* to access the paint.
* @param colors optional array of per-vertex colors, supercedes
* the paint's color field.
* @param indices optional array of indices. If NULL vertices
* are drawn non-indexed.
* @param indexCount if indices is non-null then this is the
* number of indices.
*/
void drawVertices(const GrPaint& paint,
GrPrimitiveType primitiveType,
int vertexCount,
const GrPoint positions[],
const GrPoint texs[],
const GrColor colors[],
const uint16_t indices[],
int indexCount);
/**
* Similar to drawVertices but caller provides objects that convert to Gr
* types. The count of vertices is given by posSrc.
*
* @param paint describes how to color pixels.
* @param primitiveType primitives type to draw.
* @param posSrc Source of vertex positions. Must implement
* int count() const;
* void writeValue(int i, GrPoint* point) const;
* count returns the total number of vertices and
* writeValue writes a vertex position to point.
* @param texSrc optional, pass NULL to not use explicit tex
* coords. If present provides tex coords with
* method:
* void writeValue(int i, GrPoint* point) const;
* @param texSrc optional, pass NULL to not use per-vertex colors
* If present provides colors with method:
* void writeValue(int i, GrColor* point) const;
* @param indices optional, pass NULL for non-indexed drawing. If
* present supplies indices for indexed drawing
* with following methods:
* int count() const;
* void writeValue(int i, uint16_t* point) const;
* count returns the number of indices and
* writeValue supplies each index.
*/
template <typename POS_SRC,
typename TEX_SRC,
typename COL_SRC,
typename IDX_SRC>
void drawCustomVertices(const GrPaint& paint,
GrPrimitiveType primitiveType,
const POS_SRC& posSrc,
const TEX_SRC* texCoordSrc,
const COL_SRC* colorSrc,
const IDX_SRC* idxSrc);
/**
* To avoid the problem of having to create a typename for NULL parameters,
* these reduced versions of drawCustomVertices are provided.
*/
template <typename POS_SRC>
void drawCustomVertices(const GrPaint& paint,
GrPrimitiveType primitiveType,
const POS_SRC& posSrc);
template <typename POS_SRC, typename TEX_SRC>
void drawCustomVertices(const GrPaint& paint,
GrPrimitiveType primitiveType,
const POS_SRC& posSrc,
const TEX_SRC* texCoordSrc);
template <typename POS_SRC, typename TEX_SRC, typename COL_SRC>
void drawCustomVertices(const GrPaint& paint,
GrPrimitiveType primitiveType,
const POS_SRC& posSrc,
const TEX_SRC* texCoordSrc,
const COL_SRC* colorSrc);
///////////////////////////////////////////////////////////////////////////
// Misc.
/**
* Flags that affect flush() behavior.
*/
enum FlushBits {
/**
* A client may want Gr to bind a GrRenderTarget in the 3D API so that
* it can be rendered to directly. However, Gr lazily sets state. Simply
* calling setRenderTarget() followed by flush() without flags may not
* bind the render target. This flag forces the context to bind the last
* set render target in the 3D API.
*/
kForceCurrentRenderTarget_FlushBit = 0x1,
/**
* A client may reach a point where it has partially rendered a frame
* through a GrContext that it knows the user will never see. This flag
* causes the flush to skip submission of deferred content to the 3D API
* during the flush.
*/
kDiscard_FlushBit = 0x2,
};
/**
* Call to ensure all drawing to the context has been issued to the
* underlying 3D API.
* @param flagsBitfield flags that control the flushing behavior. See
* FlushBits.
*/
void flush(int flagsBitfield = 0);
/**
* Reads a rectangle of pixels from a render target.
* @param renderTarget the render target to read from. NULL means the
* current render target.
* @param left left edge of the rectangle to read (inclusive)
* @param top top edge of the rectangle to read (inclusive)
* @param width width of rectangle to read in pixels.
* @param height height of rectangle to read in pixels.
* @param config the pixel config of the destination buffer
* @param buffer memory to read the rectangle into.
*
* @return true if the read succeeded, false if not. The read can fail
* because of a unsupported pixel config or because no render
* target is currently set.
*/
bool readRenderTargetPixels(GrRenderTarget* target,
int left, int top, int width, int height,
GrPixelConfig config, void* buffer);
/**
* Reads a rectangle of pixels from a texture.
* @param texture the render target to read from.
* @param left left edge of the rectangle to read (inclusive)
* @param top top edge of the rectangle to read (inclusive)
* @param width width of rectangle to read in pixels.
* @param height height of rectangle to read in pixels.
* @param config the pixel config of the destination buffer
* @param buffer memory to read the rectangle into.
*
* @return true if the read succeeded, false if not. The read can fail
* because of a unsupported pixel config.
*/
bool readTexturePixels(GrTexture* target,
int left, int top, int width, int height,
GrPixelConfig config, void* buffer);
/**
* Copy the src pixels [buffer, stride, pixelconfig] into the current
* render-target at the specified rectangle.
*/
void writePixels(int left, int top, int width, int height,
GrPixelConfig, const void* buffer, size_t stride);
///////////////////////////////////////////////////////////////////////////
// Helpers
class AutoRenderTarget : ::GrNoncopyable {
public:
AutoRenderTarget(GrContext* context, GrRenderTarget* target) {
fContext = NULL;
fPrevTarget = context->getRenderTarget();
if (fPrevTarget != target) {
context->setRenderTarget(target);
fContext = context;
}
}
~AutoRenderTarget() {
if (fContext) {
fContext->setRenderTarget(fPrevTarget);
}
}
private:
GrContext* fContext;
GrRenderTarget* fPrevTarget;
};
///////////////////////////////////////////////////////////////////////////
// Functions intended for internal use only.
GrGpu* getGpu() { return fGpu; }
GrFontCache* getFontCache() { return fFontCache; }
GrDrawTarget* getTextTarget(const GrPaint& paint);
void flushText();
const GrIndexBuffer* getQuadIndexBuffer() const;
void resetStats();
const GrGpuStats& getStats() const;
void printStats() const;
private:
// used to keep track of when we need to flush the draw buffer
enum DrawCategory {
kBuffered_DrawCategory, // last draw was inserted in draw buffer
kUnbuffered_DrawCategory, // last draw was not inserted in the draw buffer
kText_DrawCategory // text context was last to draw
};
DrawCategory fLastDrawCategory;
GrGpu* fGpu;
GrTextureCache* fTextureCache;
GrFontCache* fFontCache;
GrPathRenderer* fCustomPathRenderer;
GrDefaultPathRenderer fDefaultPathRenderer;
GrVertexBufferAllocPool* fDrawBufferVBAllocPool;
GrIndexBufferAllocPool* fDrawBufferIBAllocPool;
GrInOrderDrawBuffer* fDrawBuffer;
GrIndexBuffer* fAAFillRectIndexBuffer;
GrIndexBuffer* fAAStrokeRectIndexBuffer;
int fMaxOffscreenAASize;
GrContext(GrGpu* gpu);
void fillAARect(GrDrawTarget* target,
const GrPaint& paint,
const GrRect& devRect);
void strokeAARect(GrDrawTarget* target,
const GrPaint& paint,
const GrRect& devRect,
const GrVec& devStrokeSize);
inline int aaFillRectIndexCount() const;
GrIndexBuffer* aaFillRectIndexBuffer();
inline int aaStrokeRectIndexCount() const;
GrIndexBuffer* aaStrokeRectIndexBuffer();
void setupDrawBuffer();
void flushDrawBuffer();
static void SetPaint(const GrPaint& paint, GrDrawTarget* target);
bool finalizeTextureKey(GrTextureKey*,
const GrSamplerState&,
bool keyless) const;
GrDrawTarget* prepareToDraw(const GrPaint& paint, DrawCategory drawType);
void drawClipIntoStencil();
GrPathRenderer* getPathRenderer(const GrDrawTarget*, const GrPath&, GrPathFill);
struct OffscreenRecord;
// determines whether offscreen AA should be applied
bool doOffscreenAA(GrDrawTarget* target,
const GrPaint& paint,
bool isLines) const;
// attempts to setup offscreen AA. All paint state must be transferred to
// target by the time this is called.
bool prepareForOffscreenAA(GrDrawTarget* target,
bool requireStencil,
const GrIRect& boundRect,
GrPathRenderer* pr,
OffscreenRecord* record);
// sets up target to draw coverage to the supersampled render target
void setupOffscreenAAPass1(GrDrawTarget* target,
const GrIRect& boundRect,
int tileX, int tileY,
OffscreenRecord* record);
// sets up target to sample coverage of supersampled render target back
// to the main render target using stage kOffscreenStage.
void doOffscreenAAPass2(GrDrawTarget* target,
const GrPaint& paint,
const GrIRect& boundRect,
int tileX, int tileY,
OffscreenRecord* record);
// restored the draw target state and releases offscreen target to cache
void cleanupOffscreenAA(GrDrawTarget* target,
GrPathRenderer* pr,
OffscreenRecord* record);
// computes vertex layout bits based on the paint. If paint expresses
// a texture for a stage, the stage coords will be bound to postitions
// unless hasTexCoords[s]==true in which case stage s's input coords
// are bound to tex coord index s. hasTexCoords == NULL is a shortcut
// for an array where all the values are false.
static int PaintStageVertexLayoutBits(
const GrPaint& paint,
const bool hasTexCoords[GrPaint::kTotalStages]);
};
/**
* Save/restore the view-matrix in the context.
*/
class GrAutoMatrix : GrNoncopyable {
public:
GrAutoMatrix(GrContext* ctx) : fContext(ctx) {
fMatrix = ctx->getMatrix();
}
GrAutoMatrix(GrContext* ctx, const GrMatrix& matrix) : fContext(ctx) {
fMatrix = ctx->getMatrix();
ctx->setMatrix(matrix);
}
~GrAutoMatrix() {
fContext->setMatrix(fMatrix);
}
private:
GrContext* fContext;
GrMatrix fMatrix;
};
#endif
#include "GrContext_impl.h"

View File

@ -0,0 +1,134 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrContext_impl_DEFINED
#define GrContext_impl_DEFINED
template <typename POS_SRC, typename TEX_SRC,
typename COL_SRC, typename IDX_SRC>
inline void GrContext::drawCustomVertices(const GrPaint& paint,
GrPrimitiveType primitiveType,
const POS_SRC& posSrc,
const TEX_SRC* texCoordSrc,
const COL_SRC* colorSrc,
const IDX_SRC* idxSrc) {
GrDrawTarget::AutoReleaseGeometry geo;
GrDrawTarget* target = this->prepareToDraw(paint, kUnbuffered_DrawCategory);
bool hasTexCoords[GrPaint::kTotalStages] = {
NULL != texCoordSrc, // texCoordSrc provides explicit stage 0 coords
0 // remaining stages use positions
};
GrVertexLayout layout = PaintStageVertexLayoutBits(paint, hasTexCoords);
if (NULL != colorSrc) {
layout |= GrDrawTarget::kColor_VertexLayoutBit;
}
int vertexCount = posSrc.count();
int indexCount = (NULL != idxSrc) ? idxSrc->count() : 0;
if (!geo.set(target, layout, vertexCount, indexCount)) {
GrPrintf("Failed to get space for vertices!");
return;
}
int texOffsets[GrDrawTarget::kMaxTexCoords];
int colorOffset;
int vsize = GrDrawTarget::VertexSizeAndOffsetsByIdx(layout,
texOffsets,
&colorOffset);
void* curVertex = geo.vertices();
for (int i = 0; i < vertexCount; ++i) {
posSrc.writeValue(i, (GrPoint*)curVertex);
if (texOffsets[0] > 0) {
texCoordSrc->writeValue(i, (GrPoint*)((intptr_t)curVertex + texOffsets[0]));
}
if (colorOffset > 0) {
colorSrc->writeValue(i, (GrColor*)((intptr_t)curVertex + colorOffset));
}
curVertex = (void*)((intptr_t)curVertex + vsize);
}
uint16_t* indices = (uint16_t*) geo.indices();
for (int i = 0; i < indexCount; ++i) {
idxSrc->writeValue(i, indices + i);
}
// we don't currently apply offscreen AA to this path. Need improved
// management of GrDrawTarget's geometry to avoid copying points per-tile.
if (NULL == idxSrc) {
target->drawNonIndexed(primitiveType, 0, vertexCount);
} else {
target->drawIndexed(primitiveType, 0, 0, vertexCount, indexCount);
}
}
class GrNullTexCoordSource {
public:
void writeValue(int i, GrPoint* dstCoord) const { GrAssert(false); }
};
class GrNullColorSource {
public:
void writeValue(int i, GrColor* dstColor) const { GrAssert(false); }
};
class GrNullIndexSource {
public:
void writeValue(int i, uint16_t* dstIndex) const { GrAssert(false); }
int count() const { GrAssert(false); return 0; }
};
template <typename POS_SRC>
inline void GrContext::drawCustomVertices(const GrPaint& paint,
GrPrimitiveType primitiveType,
const POS_SRC& posSrc) {
this->drawCustomVertices<POS_SRC,
GrNullTexCoordSource,
GrNullColorSource,
GrNullIndexSource>(paint, primitiveType, posSrc,
NULL, NULL, NULL);
}
template <typename POS_SRC, typename TEX_SRC>
inline void GrContext::drawCustomVertices(const GrPaint& paint,
GrPrimitiveType primitiveType,
const POS_SRC& posSrc,
const TEX_SRC* texCoordSrc) {
this->drawCustomVertices<POS_SRC, TEX_SRC,
GrNullColorSource,
GrNullIndexSource>(paint, primitiveType, posSrc,
texCoordSrc, NULL, NULL);
}
template <typename POS_SRC, typename TEX_SRC, typename COL_SRC>
inline void GrContext::drawCustomVertices(const GrPaint& paint,
GrPrimitiveType primitiveType,
const POS_SRC& posSrc,
const TEX_SRC* texCoordSrc,
const COL_SRC* colorSrc) {
drawCustomVertices<POS_SRC, TEX_SRC, COL_SRC,
GrNullIndexSource>(paint, primitiveType, posSrc,
texCoordSrc, colorSrc, NULL);
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,44 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrFontScaler_DEFINED
#define GrFontScaler_DEFINED
#include "GrGlyph.h"
#include "GrKey.h"
class SkPath;
/**
* This is a virtual base class which Gr's interface to the host platform's
* font scaler.
*
* The client is responsible for subclassing, and instantiating this. The
* instance is create for a specific font+size+matrix.
*/
class GrFontScaler : public GrRefCnt {
public:
virtual const GrKey* getKey() = 0;
virtual GrMaskFormat getMaskFormat() = 0;
virtual bool getPackedGlyphBounds(GrGlyph::PackedID, GrIRect* bounds) = 0;
virtual bool getPackedGlyphImage(GrGlyph::PackedID, int width, int height,
int rowBytes, void* image) = 0;
virtual bool getGlyphPath(uint16_t glyphID, SkPath*) = 0;
};
#endif

View File

@ -0,0 +1,193 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrGLConfig_DEFINED
#define GrGLConfig_DEFINED
#include "GrTypes.h"
#include "GrGLDefines.h"
/**
* Optional GL config file.
*/
#ifdef GR_GL_CUSTOM_SETUP_HEADER
#include GR_GL_CUSTOM_SETUP_HEADER
#endif
#if !defined(GR_GL_FUNCTION_TYPE)
#define GR_GL_FUNCTION_TYPE
#endif
/**
* The following are optional defines that can be enabled at the compiler
* command line, in a IDE project, in a GrUserConfig.h file, or in a GL custom
* file (if one is in use). If a GR_GL_CUSTOM_SETUP_HEADER is used they can
* also be placed there.
*
* GR_GL_LOG_CALLS: if 1 Gr can print every GL call using GrPrintf. Defaults to
* 0. Logging can be enabled and disabled at runtime using a debugger via to
* global gLogCallsGL. The initial value of gLogCallsGL is controlled by
* GR_GL_LOG_CALLS_START.
*
* GR_GL_LOG_CALLS_START: controls the initial value of gLogCallsGL when
* GR_GL_LOG_CALLS is 1. Defaults to 0.
*
* GR_GL_CHECK_ERROR: if enabled Gr can do a glGetError() after every GL call.
* Defaults to 1 if GR_DEBUG is set, otherwise 0. When GR_GL_CHECK_ERROR is 1
* this can be toggled in a debugger using the gCheckErrorGL global. The initial
* value of gCheckErrorGL is controlled by by GR_GL_CHECK_ERROR_START.
*
* GR_GL_CHECK_ERROR_START: controls the initial value of gCheckErrorGL
* when GR_GL_CHECK_ERROR is 1. Defaults to 1.
*
* GR_GL_NO_CONSTANT_ATTRIBUTES: if this evaluates to true then the GL backend
* will use uniforms instead of attributes in all cases when there is not
* per-vertex data. This is important when the underlying GL implementation
* doesn't actually support immediate style attribute values (e.g. when
* the GL stream is converted to DX as in ANGLE on Chrome). Defaults to 0.
*
* GR_GL_ATTRIBUTE_MATRICES: If changing uniforms is very expensive it may be
* faster to use vertex attributes for matrices (set via glVertexAttrib3fv).
* Setting this build flag enables this behavior. GR_GL_NO_CONSTANT_ATTRIBUTES
* must not be set since this uses constant attributes for the matrices.
* Defaults to 0.
*/
#if !defined(GR_GL_LOG_CALLS)
#define GR_GL_LOG_CALLS 0
#endif
#if !defined(GR_GL_LOG_CALLS_START)
#define GR_GL_LOG_CALLS_START 0
#endif
#if !defined(GR_GL_CHECK_ERROR)
#define GR_GL_CHECK_ERROR GR_DEBUG
#endif
#if !defined(GR_GL_CHECK_ERROR_START)
#define GR_GL_CHECK_ERROR_START 1
#endif
#if !defined(GR_GL_NO_CONSTANT_ATTRIBUTES)
#define GR_GL_NO_CONSTANT_ATTRIBUTES 0
#endif
#if !defined(GR_GL_ATTRIBUTE_MATRICES)
#define GR_GL_ATTRIBUTE_MATRICES 0
#endif
#if(GR_GL_NO_CONSTANT_ATTRIBUTES) && (GR_GL_ATTRIBUTE_MATRICES)
#error "Cannot combine GR_GL_NO_CONSTANT_ATTRIBUTES and GR_GL_ATTRIBUTE_MATRICES"
#endif
////////////////////////////////////////////////////////////////////////////////
/**
* The following macros are used to staticlly configure the default
* GrGLInterface, but should not be used outside of the GrGLInterface
* scaffolding. Undefine here to prevent accidental use.
*/
#undef GR_SUPPORT_GLDESKTOP
#undef GR_SUPPORT_GLES1
#undef GR_SUPPORT_GLES2
#undef GR_SUPPORT_GLES
////////////////////////////////////////////////////////////////////////////////
#if GR_SCALAR_IS_FIXED
#define GrGLType GL_FIXED
#elif GR_SCALAR_IS_FLOAT
#define GrGLType GR_GL_FLOAT
#else
#error "unknown GR_SCALAR type"
#endif
#if GR_TEXT_SCALAR_IS_USHORT
#define GrGLTextType GR_GL_UNSIGNED_SHORT
#define GR_GL_TEXT_TEXTURE_NORMALIZED 1
#elif GR_TEXT_SCALAR_IS_FLOAT
#define GrGLTextType GR_GL_FLOAT
#define GR_GL_TEXT_TEXTURE_NORMALIZED 0
#elif GR_TEXT_SCALAR_IS_FIXED
#define GrGLTextType GR_GL_FIXED
#define GR_GL_TEXT_TEXTURE_NORMALIZED 0
#else
#error "unknown GR_TEXT_SCALAR type"
#endif
// Pick a pixel config for 32bit bitmaps. Our default is GL_RGBA (except on
// Windows where we match GDI's order).
#ifndef GR_GL_32BPP_COLOR_FORMAT
#if GR_WIN32_BUILD || GR_LINUX_BUILD || GR_QNX_BUILD
#define GR_GL_32BPP_COLOR_FORMAT GR_GL_BGRA
#else
#define GR_GL_32BPP_COLOR_FORMAT GR_GL_RGBA
#endif
#endif
////////////////////////////////////////////////////////////////////////////////
extern void GrGLCheckErr(const char* location, const char* call);
extern void GrGLClearErr();
#if GR_GL_CHECK_ERROR
extern bool gCheckErrorGL;
#define GR_GL_CHECK_ERROR_IMPL(X) if (gCheckErrorGL) GrGLCheckErr(GR_FILE_AND_LINE_STR, #X)
#else
#define GR_GL_CHECK_ERROR_IMPL(X)
#endif
#if GR_GL_LOG_CALLS
extern bool gLogCallsGL;
#define GR_GL_LOG_CALLS_IMPL(X) if (gLogCallsGL) GrPrintf(GR_FILE_AND_LINE_STR "GL: " #X "\n")
#else
#define GR_GL_LOG_CALLS_IMPL(X)
#endif
#define GR_GL(X) GrGLGetGLInterface()->f##X;; GR_GL_LOG_CALLS_IMPL(X); GR_GL_CHECK_ERROR_IMPL(X);
#define GR_GL_NO_ERR(X) GrGLGetGLInterface()->f##X;; GR_GL_LOG_CALLS_IMPL(X);
#define GR_GL_SUPPORT_DESKTOP (kDesktop_GrGLBinding == GrGLGetGLInterface()->fBindingsExported)
#define GR_GL_SUPPORT_ES1 (kES1_GrGLBinding == GrGLGetGLInterface()->fBindingsExported)
#define GR_GL_SUPPORT_ES2 (kES2_GrGLBinding == GrGLGetGLInterface()->fBindingsExported)
#define GR_GL_SUPPORT_ES (GR_GL_SUPPORT_ES1 || GR_GL_SUPPORT_ES2)
////////////////////////////////////////////////////////////////////////////////
/**
* GrGLRestoreResetRowLength() will reset GL_UNPACK_ROW_LENGTH to 0. We write
* this wrapper, since GL_UNPACK_ROW_LENGTH is not available on all GL versions
*/
extern void GrGLRestoreResetRowLength();
////////////////////////////////////////////////////////////////////////////////
/**
* Some drivers want the var-int arg to be zero-initialized on input.
*/
#define GR_GL_INIT_ZERO 0
#define GR_GL_GetIntegerv(e, p) \
do { \
*(p) = GR_GL_INIT_ZERO; \
GR_GL(GetIntegerv(e, p)); \
} while (0)
////////////////////////////////////////////////////////////////////////////////
#endif

View File

@ -0,0 +1,13 @@
#ifndef GrGLConfig_chrome_DEFINED
#define GrGLConfig_chrome_DEFINED
// chrome always assumes BGRA
#define GR_GL_32BPP_COLOR_FORMAT GR_GL_BGRA
// glGetError() forces a sync with gpu process on chrome
#define GR_GL_CHECK_ERROR_START 0
// ANGLE creates a temp VB for vertex attributes not specified per-vertex.
#define GR_GL_NO_CONSTANT_ATTRIBUTES GR_WIN32_BUILD
#endif

View File

@ -0,0 +1,652 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrGLDefines_DEFINED
#define GrGLDefines_DEFINED
// The following constants consist of the intersection of GL constants
// exported by GLES 1.0, GLES 2.0, and desktop GL required by the system.
#define GR_GL_DEPTH_BUFFER_BIT 0x00000100
#define GR_GL_STENCIL_BUFFER_BIT 0x00000400
#define GR_GL_COLOR_BUFFER_BIT 0x00004000
/* Boolean */
#define GR_GL_FALSE 0
#define GR_GL_TRUE 1
/* BeginMode */
#define GR_GL_POINTS 0x0000
#define GR_GL_LINES 0x0001
#define GR_GL_LINE_LOOP 0x0002
#define GR_GL_LINE_STRIP 0x0003
#define GR_GL_TRIANGLES 0x0004
#define GR_GL_TRIANGLE_STRIP 0x0005
#define GR_GL_TRIANGLE_FAN 0x0006
/* AlphaFunction (not supported in ES20) */
/* GL_NEVER */
/* GL_LESS */
/* GL_EQUAL */
/* GL_LEQUAL */
/* GL_GREATER */
/* GL_NOTEQUAL */
/* GL_GEQUAL */
/* GL_ALWAYS */
/* BlendingFactorDest */
#define GR_GL_ZERO 0
#define GR_GL_ONE 1
#define GR_GL_SRC_COLOR 0x0300
#define GR_GL_ONE_MINUS_SRC_COLOR 0x0301
#define GR_GL_SRC_ALPHA 0x0302
#define GR_GL_ONE_MINUS_SRC_ALPHA 0x0303
#define GR_GL_DST_ALPHA 0x0304
#define GR_GL_ONE_MINUS_DST_ALPHA 0x0305
/* BlendingFactorSrc */
/* GL_ZERO */
/* GL_ONE */
#define GR_GL_DST_COLOR 0x0306
#define GR_GL_ONE_MINUS_DST_COLOR 0x0307
#define GR_GL_SRC_ALPHA_SATURATE 0x0308
/* GL_SRC_ALPHA */
/* GL_ONE_MINUS_SRC_ALPHA */
/* GL_DST_ALPHA */
/* GL_ONE_MINUS_DST_ALPHA */
/* ExtendedBlendFactors */
#define GR_GL_SRC1_COLOR 0x88F9
#define GR_GL_ONE_MINUS_SRC1_COLOR 0x88FA
/* GL_SRC1_ALPHA */
#define GR_GL_ONE_MINUS_SRC1_ALPHA 0x88FB
/* BlendEquationSeparate */
#define GR_GL_FUNC_ADD 0x8006
#define GR_GL_BLEND_EQUATION 0x8009
#define GR_GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */
#define GR_GL_BLEND_EQUATION_ALPHA 0x883D
/* BlendSubtract */
#define GR_GL_FUNC_SUBTRACT 0x800A
#define GR_GL_FUNC_REVERSE_SUBTRACT 0x800B
/* Separate Blend Functions */
#define GR_GL_BLEND_DST_RGB 0x80C8
#define GR_GL_BLEND_SRC_RGB 0x80C9
#define GR_GL_BLEND_DST_ALPHA 0x80CA
#define GR_GL_BLEND_SRC_ALPHA 0x80CB
#define GR_GL_CONSTANT_COLOR 0x8001
#define GR_GL_ONE_MINUS_CONSTANT_COLOR 0x8002
#define GR_GL_CONSTANT_ALPHA 0x8003
#define GR_GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
#define GR_GL_BLEND_COLOR 0x8005
/* Buffer Objects */
#define GR_GL_ARRAY_BUFFER 0x8892
#define GR_GL_ELEMENT_ARRAY_BUFFER 0x8893
#define GR_GL_ARRAY_BUFFER_BINDING 0x8894
#define GR_GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
#define GR_GL_STREAM_DRAW 0x88E0
#define GR_GL_STATIC_DRAW 0x88E4
#define GR_GL_DYNAMIC_DRAW 0x88E8
#define GR_GL_BUFFER_SIZE 0x8764
#define GR_GL_BUFFER_USAGE 0x8765
#define GR_GL_CURRENT_VERTEX_ATTRIB 0x8626
/* CullFaceMode */
#define GR_GL_FRONT 0x0404
#define GR_GL_BACK 0x0405
#define GR_GL_FRONT_AND_BACK 0x0408
/* DepthFunction */
/* GL_NEVER */
/* GL_LESS */
/* GL_EQUAL */
/* GL_LEQUAL */
/* GL_GREATER */
/* GL_NOTEQUAL */
/* GL_GEQUAL */
/* GL_ALWAYS */
/* EnableCap */
#define GR_GL_TEXTURE_2D 0x0DE1
#define GR_GL_CULL_FACE 0x0B44
#define GR_GL_BLEND 0x0BE2
#define GR_GL_DITHER 0x0BD0
#define GR_GL_STENCIL_TEST 0x0B90
#define GR_GL_DEPTH_TEST 0x0B71
#define GR_GL_SCISSOR_TEST 0x0C11
#define GR_GL_POLYGON_OFFSET_FILL 0x8037
#define GR_GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
#define GR_GL_SAMPLE_COVERAGE 0x80A0
/* ErrorCode */
#define GR_GL_NO_ERROR 0
#define GR_GL_INVALID_ENUM 0x0500
#define GR_GL_INVALID_VALUE 0x0501
#define GR_GL_INVALID_OPERATION 0x0502
#define GR_GL_OUT_OF_MEMORY 0x0505
#define GR_GL_CONTEXT_LOST 0x300E // TODO(gman): What value?
/* FrontFaceDirection */
#define GR_GL_CW 0x0900
#define GR_GL_CCW 0x0901
/* GetPName */
#define GR_GL_LINE_WIDTH 0x0B21
#define GR_GL_ALIASED_POINT_SIZE_RANGE 0x846D
#define GR_GL_ALIASED_LINE_WIDTH_RANGE 0x846E
#define GR_GL_CULL_FACE_MODE 0x0B45
#define GR_GL_FRONT_FACE 0x0B46
#define GR_GL_DEPTH_RANGE 0x0B70
#define GR_GL_DEPTH_WRITEMASK 0x0B72
#define GR_GL_DEPTH_CLEAR_VALUE 0x0B73
#define GR_GL_DEPTH_FUNC 0x0B74
#define GR_GL_STENCIL_CLEAR_VALUE 0x0B91
#define GR_GL_STENCIL_FUNC 0x0B92
#define GR_GL_STENCIL_FAIL 0x0B94
#define GR_GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
#define GR_GL_STENCIL_PASS_DEPTH_PASS 0x0B96
#define GR_GL_STENCIL_REF 0x0B97
#define GR_GL_STENCIL_VALUE_MASK 0x0B93
#define GR_GL_STENCIL_WRITEMASK 0x0B98
#define GR_GL_STENCIL_BACK_FUNC 0x8800
#define GR_GL_STENCIL_BACK_FAIL 0x8801
#define GR_GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
#define GR_GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
#define GR_GL_STENCIL_BACK_REF 0x8CA3
#define GR_GL_STENCIL_BACK_VALUE_MASK 0x8CA4
#define GR_GL_STENCIL_BACK_WRITEMASK 0x8CA5
#define GR_GL_VIEWPORT 0x0BA2
#define GR_GL_SCISSOR_BOX 0x0C10
/* GL_SCISSOR_TEST */
#define GR_GL_COLOR_CLEAR_VALUE 0x0C22
#define GR_GL_COLOR_WRITEMASK 0x0C23
#define GR_GL_UNPACK_ALIGNMENT 0x0CF5
#define GR_GL_PACK_ALIGNMENT 0x0D05
#define GR_GL_MAX_TEXTURE_SIZE 0x0D33
#define GR_GL_MAX_VIEWPORT_DIMS 0x0D3A
#define GR_GL_SUBPIXEL_BITS 0x0D50
#define GR_GL_RED_BITS 0x0D52
#define GR_GL_GREEN_BITS 0x0D53
#define GR_GL_BLUE_BITS 0x0D54
#define GR_GL_ALPHA_BITS 0x0D55
#define GR_GL_DEPTH_BITS 0x0D56
#define GR_GL_STENCIL_BITS 0x0D57
#define GR_GL_POLYGON_OFFSET_UNITS 0x2A00
/* GL_POLYGON_OFFSET_FILL */
#define GR_GL_POLYGON_OFFSET_FACTOR 0x8038
#define GR_GL_TEXTURE_BINDING_2D 0x8069
#define GR_GL_SAMPLE_BUFFERS 0x80A8
#define GR_GL_SAMPLES 0x80A9
#define GR_GL_SAMPLE_COVERAGE_VALUE 0x80AA
#define GR_GL_SAMPLE_COVERAGE_INVERT 0x80AB
/* GetTextureParameter */
/* GL_TEXTURE_MAG_FILTER */
/* GL_TEXTURE_MIN_FILTER */
/* GL_TEXTURE_WRAP_S */
/* GL_TEXTURE_WRAP_T */
#define GR_GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
#define GR_GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
/* HintMode */
#define GR_GL_DONT_CARE 0x1100
#define GR_GL_FASTEST 0x1101
#define GR_GL_NICEST 0x1102
/* HintTarget */
#define GR_GL_GENERATE_MIPMAP_HINT 0x8192
/* DataType */
#define GR_GL_BYTE 0x1400
#define GR_GL_UNSIGNED_BYTE 0x1401
#define GR_GL_SHORT 0x1402
#define GR_GL_UNSIGNED_SHORT 0x1403
#define GR_GL_INT 0x1404
#define GR_GL_UNSIGNED_INT 0x1405
#define GR_GL_FLOAT 0x1406
#define GR_GL_FIXED 0x140C
/* Lighting */
#define GR_GL_LIGHTING 0x0B50
#define GR_GL_LIGHT0 0x4000
#define GR_GL_LIGHT1 0x4001
#define GR_GL_LIGHT2 0x4002
#define GR_GL_LIGHT3 0x4003
#define GR_GL_LIGHT4 0x4004
#define GR_GL_LIGHT5 0x4005
#define GR_GL_LIGHT6 0x4006
#define GR_GL_LIGHT7 0x4007
#define GR_GL_SPOT_EXPONENT 0x1205
#define GR_GL_SPOT_CUTOFF 0x1206
#define GR_GL_CONSTANT_ATTENUATION 0x1207
#define GR_GL_LINEAR_ATTENUATION 0x1208
#define GR_GL_QUADRATIC_ATTENUATION 0x1209
#define GR_GL_AMBIENT 0x1200
#define GR_GL_DIFFUSE 0x1201
#define GR_GL_SPECULAR 0x1202
#define GR_GL_SHININESS 0x1601
#define GR_GL_EMISSION 0x1600
#define GR_GL_POSITION 0x1203
#define GR_GL_SPOT_DIRECTION 0x1204
#define GR_GL_AMBIENT_AND_DIFFUSE 0x1602
#define GR_GL_COLOR_INDEXES 0x1603
#define GR_GL_LIGHT_MODEL_TWO_SIDE 0x0B52
#define GR_GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
#define GR_GL_LIGHT_MODEL_AMBIENT 0x0B53
#define GR_GL_FRONT_AND_BACK 0x0408
#define GR_GL_SHADE_MODEL 0x0B54
#define GR_GL_FLAT 0x1D00
#define GR_GL_SMOOTH 0x1D01
#define GR_GL_COLOR_MATERIAL 0x0B57
#define GR_GL_COLOR_MATERIAL_FACE 0x0B55
#define GR_GL_COLOR_MATERIAL_PARAMETER 0x0B56
#define GR_GL_NORMALIZE 0x0BA1
/* Matrix Mode */
#define GR_GL_MATRIX_MODE 0x0BA0
#define GR_GL_MODELVIEW 0x1700
#define GR_GL_PROJECTION 0x1701
#define GR_GL_TEXTURE 0x1702
/* multisample */
#define GR_GL_MULTISAMPLE 0x809D
/* Points */
#define GR_GL_POINT_SMOOTH 0x0B10
#define GR_GL_POINT_SIZE 0x0B11
#define GR_GL_POINT_SIZE_GRANULARITY 0x0B13
#define GR_GL_POINT_SIZE_RANGE 0x0B12
/* Lines */
#define GR_GL_LINE_SMOOTH 0x0B20
#define GR_GL_LINE_STIPPLE 0x0B24
#define GR_GL_LINE_STIPPLE_PATTERN 0x0B25
#define GR_GL_LINE_STIPPLE_REPEAT 0x0B26
#define GR_GL_LINE_WIDTH 0x0B21
#define GR_GL_LINE_WIDTH_GRANULARITY 0x0B23
#define GR_GL_LINE_WIDTH_RANGE 0x0B22
/* PixelFormat */
#define GR_GL_DEPTH_COMPONENT 0x1902
#define GR_GL_ALPHA 0x1906
#define GR_GL_RGB 0x1907
#define GR_GL_RGBA 0x1908
#define GR_GL_BGRA 0x80E1
#define GR_GL_LUMINANCE 0x1909
#define GR_GL_LUMINANCE_ALPHA 0x190A
#define GR_GL_PALETTE8_RGBA8 0x8B96
/* PixelType */
/* GL_UNSIGNED_BYTE */
#define GR_GL_UNSIGNED_SHORT_4_4_4_4 0x8033
#define GR_GL_UNSIGNED_SHORT_5_5_5_1 0x8034
#define GR_GL_UNSIGNED_SHORT_5_6_5 0x8363
/* Shaders */
#define GR_GL_FRAGMENT_SHADER 0x8B30
#define GR_GL_VERTEX_SHADER 0x8B31
#define GR_GL_MAX_VERTEX_ATTRIBS 0x8869
#define GR_GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
#define GR_GL_MAX_VARYING_VECTORS 0x8DFC
#define GR_GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
#define GR_GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
#define GR_GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
#define GR_GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
#define GR_GL_SHADER_TYPE 0x8B4F
#define GR_GL_DELETE_STATUS 0x8B80
#define GR_GL_LINK_STATUS 0x8B82
#define GR_GL_VALIDATE_STATUS 0x8B83
#define GR_GL_ATTACHED_SHADERS 0x8B85
#define GR_GL_ACTIVE_UNIFORMS 0x8B86
#define GR_GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
#define GR_GL_ACTIVE_ATTRIBUTES 0x8B89
#define GR_GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
#define GR_GL_SHADING_LANGUAGE_VERSION 0x8B8C
#define GR_GL_CURRENT_PROGRAM 0x8B8D
#define GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
#define GR_GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
/* StencilFunction */
#define GR_GL_NEVER 0x0200
#define GR_GL_LESS 0x0201
#define GR_GL_EQUAL 0x0202
#define GR_GL_LEQUAL 0x0203
#define GR_GL_GREATER 0x0204
#define GR_GL_NOTEQUAL 0x0205
#define GR_GL_GEQUAL 0x0206
#define GR_GL_ALWAYS 0x0207
/* StencilOp */
/* GL_ZERO */
#define GR_GL_KEEP 0x1E00
#define GR_GL_REPLACE 0x1E01
#define GR_GL_INCR 0x1E02
#define GR_GL_DECR 0x1E03
#define GR_GL_INVERT 0x150A
#define GR_GL_INCR_WRAP 0x8507
#define GR_GL_DECR_WRAP 0x8508
/* StringName */
#define GR_GL_VENDOR 0x1F00
#define GR_GL_RENDERER 0x1F01
#define GR_GL_VERSION 0x1F02
#define GR_GL_EXTENSIONS 0x1F03
/* Pixel Mode / Transfer */
#define GR_GL_UNPACK_ROW_LENGTH 0x0CF2
/* TextureMagFilter */
#define GR_GL_NEAREST 0x2600
#define GR_GL_LINEAR 0x2601
/* TextureMinFilter */
/* GL_NEAREST */
/* GL_LINEAR */
#define GR_GL_NEAREST_MIPMAP_NEAREST 0x2700
#define GR_GL_LINEAR_MIPMAP_NEAREST 0x2701
#define GR_GL_NEAREST_MIPMAP_LINEAR 0x2702
#define GR_GL_LINEAR_MIPMAP_LINEAR 0x2703
/* TextureParameterName */
#define GR_GL_TEXTURE_MAG_FILTER 0x2800
#define GR_GL_TEXTURE_MIN_FILTER 0x2801
#define GR_GL_TEXTURE_WRAP_S 0x2802
#define GR_GL_TEXTURE_WRAP_T 0x2803
/* TextureTarget */
/* GL_TEXTURE_2D */
#define GR_GL_TEXTURE 0x1702
#define GR_GL_TEXTURE_CUBE_MAP 0x8513
#define GR_GL_TEXTURE_BINDING_CUBE_MAP 0x8514
#define GR_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
#define GR_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
#define GR_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
#define GR_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
#define GR_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
#define GR_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
#define GR_GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
/* TextureUnit */
#define GR_GL_TEXTURE0 0x84C0
#define GR_GL_TEXTURE1 0x84C1
#define GR_GL_TEXTURE2 0x84C2
#define GR_GL_TEXTURE3 0x84C3
#define GR_GL_TEXTURE4 0x84C4
#define GR_GL_TEXTURE5 0x84C5
#define GR_GL_TEXTURE6 0x84C6
#define GR_GL_TEXTURE7 0x84C7
#define GR_GL_TEXTURE8 0x84C8
#define GR_GL_TEXTURE9 0x84C9
#define GR_GL_TEXTURE10 0x84CA
#define GR_GL_TEXTURE11 0x84CB
#define GR_GL_TEXTURE12 0x84CC
#define GR_GL_TEXTURE13 0x84CD
#define GR_GL_TEXTURE14 0x84CE
#define GR_GL_TEXTURE15 0x84CF
#define GR_GL_TEXTURE16 0x84D0
#define GR_GL_TEXTURE17 0x84D1
#define GR_GL_TEXTURE18 0x84D2
#define GR_GL_TEXTURE19 0x84D3
#define GR_GL_TEXTURE20 0x84D4
#define GR_GL_TEXTURE21 0x84D5
#define GR_GL_TEXTURE22 0x84D6
#define GR_GL_TEXTURE23 0x84D7
#define GR_GL_TEXTURE24 0x84D8
#define GR_GL_TEXTURE25 0x84D9
#define GR_GL_TEXTURE26 0x84DA
#define GR_GL_TEXTURE27 0x84DB
#define GR_GL_TEXTURE28 0x84DC
#define GR_GL_TEXTURE29 0x84DD
#define GR_GL_TEXTURE30 0x84DE
#define GR_GL_TEXTURE31 0x84DF
#define GR_GL_ACTIVE_TEXTURE 0x84E0
#define GR_GL_MAX_TEXTURE_UNITS 0x84E2
/* TextureWrapMode */
#define GR_GL_REPEAT 0x2901
#define GR_GL_CLAMP_TO_EDGE 0x812F
#define GR_GL_MIRRORED_REPEAT 0x8370
/* Texture mapping */
#define GR_GL_TEXTURE_ENV 0x2300
#define GR_GL_TEXTURE_ENV_MODE 0x2200
#define GR_GL_TEXTURE_1D 0x0DE0
#define GR_GL_TEXTURE_2D 0x0DE1
/* GL_TEXTURE_WRAP_S */
/* GL_TEXTURE_WRAP_T */
/* GL_TEXTURE_MAG_FILTER */
/* GL_TEXTURE_MIN_FILTER */
#define GR_GL_TEXTURE_ENV_COLOR 0x2201
#define GR_GL_TEXTURE_GEN_S 0x0C60
#define GR_GL_TEXTURE_GEN_T 0x0C61
#define GR_GL_TEXTURE_GEN_MODE 0x2500
#define GR_GL_TEXTURE_BORDER_COLOR 0x1004
#define GR_GL_TEXTURE_WIDTH 0x1000
#define GR_GL_TEXTURE_HEIGHT 0x1001
#define GR_GL_TEXTURE_BORDER 0x1005
#define GR_GL_TEXTURE_COMPONENTS 0x1003
#define GR_GL_TEXTURE_RED_SIZE 0x805C
#define GR_GL_TEXTURE_GREEN_SIZE 0x805D
#define GR_GL_TEXTURE_BLUE_SIZE 0x805E
#define GR_GL_TEXTURE_ALPHA_SIZE 0x805F
#define GR_GL_TEXTURE_LUMINANCE_SIZE 0x8060
#define GR_GL_TEXTURE_INTENSITY_SIZE 0x8061
/* GL_NEAREST_MIPMAP_NEAREST */
/* GL_NEAREST_MIPMAP_LINEAR */
/* GL_LINEAR_MIPMAP_NEAREST */
/* GL_LINEAR_MIPMAP_LINEAR */
#define GR_GL_OBJECT_LINEAR 0x2401
#define GR_GL_OBJECT_PLANE 0x2501
#define GR_GL_EYE_LINEAR 0x2400
#define GR_GL_EYE_PLANE 0x2502
#define GR_GL_SPHERE_MAP 0x2402
#define GR_GL_DECAL 0x2101
#define GR_GL_MODULATE 0x2100
/* GL_NEAREST */
/* GL_REPEAT */
#define GR_GL_CLAMP 0x2900
#define GR_GL_S 0x2000
#define GR_GL_T 0x2001
#define GR_GL_R 0x2002
#define GR_GL_Q 0x2003
#define GR_GL_TEXTURE_GEN_R 0x0C62
#define GR_GL_TEXTURE_GEN_Q 0x0C63
/* texture_env_combine */
#define GR_GL_COMBINE 0x8570
#define GR_GL_COMBINE_RGB 0x8571
#define GR_GL_COMBINE_ALPHA 0x8572
#define GR_GL_SOURCE0_RGB 0x8580
#define GR_GL_SOURCE1_RGB 0x8581
#define GR_GL_SOURCE2_RGB 0x8582
#define GR_GL_SOURCE0_ALPHA 0x8588
#define GR_GL_SOURCE1_ALPHA 0x8589
#define GR_GL_SOURCE2_ALPHA 0x858A
#define GR_GL_OPERAND0_RGB 0x8590
#define GR_GL_OPERAND1_RGB 0x8591
#define GR_GL_OPERAND2_RGB 0x8592
#define GR_GL_OPERAND0_ALPHA 0x8598
#define GR_GL_OPERAND1_ALPHA 0x8599
#define GR_GL_OPERAND2_ALPHA 0x859A
#define GR_GL_RGB_SCALE 0x8573
#define GR_GL_ADD_SIGNED 0x8574
#define GR_GL_INTERPOLATE 0x8575
#define GR_GL_SUBTRACT 0x84E7
#define GR_GL_CONSTANT 0x8576
#define GR_GL_PRIMARY_COLOR 0x8577
#define GR_GL_PREVIOUS 0x8578
#define GR_GL_SRC0_RGB 0x8580
#define GR_GL_SRC1_RGB 0x8581
#define GR_GL_SRC2_RGB 0x8582
#define GR_GL_SRC0_ALPHA 0x8588
#define GR_GL_SRC1_ALPHA 0x8589
#define GR_GL_SRC2_ALPHA 0x858A
/* Uniform Types */
#define GR_GL_FLOAT_VEC2 0x8B50
#define GR_GL_FLOAT_VEC3 0x8B51
#define GR_GL_FLOAT_VEC4 0x8B52
#define GR_GL_INT_VEC2 0x8B53
#define GR_GL_INT_VEC3 0x8B54
#define GR_GL_INT_VEC4 0x8B55
#define GR_GL_BOOL 0x8B56
#define GR_GL_BOOL_VEC2 0x8B57
#define GR_GL_BOOL_VEC3 0x8B58
#define GR_GL_BOOL_VEC4 0x8B59
#define GR_GL_FLOAT_MAT2 0x8B5A
#define GR_GL_FLOAT_MAT3 0x8B5B
#define GR_GL_FLOAT_MAT4 0x8B5C
#define GR_GL_SAMPLER_2D 0x8B5E
#define GR_GL_SAMPLER_CUBE 0x8B60
/* Vertex Arrays */
#define GR_GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
#define GR_GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
#define GR_GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
#define GR_GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
#define GR_GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
#define GR_GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
#define GR_GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
#define GR_GL_VERTEX_ARRAY 0x8074
#define GR_GL_NORMAL_ARRAY 0x8075
#define GR_GL_COLOR_ARRAY 0x8076
#define GR_GL_INDEX_ARRAY 0x8077
#define GR_GL_TEXTURE_COORD_ARRAY 0x8078
#define GR_GL_EDGE_FLAG_ARRAY 0x8079
#define GR_GL_VERTEX_ARRAY_SIZE 0x807A
#define GR_GL_VERTEX_ARRAY_TYPE 0x807B
#define GR_GL_VERTEX_ARRAY_STRIDE 0x807C
#define GR_GL_NORMAL_ARRAY_TYPE 0x807E
#define GR_GL_NORMAL_ARRAY_STRIDE 0x807F
#define GR_GL_COLOR_ARRAY_SIZE 0x8081
#define GR_GL_COLOR_ARRAY_TYPE 0x8082
#define GR_GL_COLOR_ARRAY_STRIDE 0x8083
#define GR_GL_INDEX_ARRAY_TYPE 0x8085
#define GR_GL_INDEX_ARRAY_STRIDE 0x8086
#define GR_GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
#define GR_GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
#define GR_GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
#define GR_GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
#define GR_GL_VERTEX_ARRAY_POINTER 0x808E
#define GR_GL_NORMAL_ARRAY_POINTER 0x808F
#define GR_GL_COLOR_ARRAY_POINTER 0x8090
#define GR_GL_INDEX_ARRAY_POINTER 0x8091
#define GR_GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
#define GR_GL_EDGE_FLAG_ARRAY_POINTER 0x8093
#define GR_GL_V2F 0x2A20
#define GR_GL_V3F 0x2A21
#define GR_GL_C4UB_V2F 0x2A22
#define GR_GL_C4UB_V3F 0x2A23
#define GR_GL_C3F_V3F 0x2A24
#define GR_GL_N3F_V3F 0x2A25
#define GR_GL_C4F_N3F_V3F 0x2A26
#define GR_GL_T2F_V3F 0x2A27
#define GR_GL_T4F_V4F 0x2A28
#define GR_GL_T2F_C4UB_V3F 0x2A29
#define GR_GL_T2F_C3F_V3F 0x2A2A
#define GR_GL_T2F_N3F_V3F 0x2A2B
#define GR_GL_T2F_C4F_N3F_V3F 0x2A2C
#define GR_GL_T4F_C4F_N3F_V4F 0x2A2D
/* Vertex Buffer Object */
#define GR_GL_WRITE_ONLY 0x88B9
#define GR_GL_BUFFER_MAPPED 0x88BC
/* Read Format */
#define GR_GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
#define GR_GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
/* Shader Source */
#define GR_GL_COMPILE_STATUS 0x8B81
#define GR_GL_INFO_LOG_LENGTH 0x8B84
#define GR_GL_SHADER_SOURCE_LENGTH 0x8B88
#define GR_GL_SHADER_COMPILER 0x8DFA
/* Shader Binary */
#define GR_GL_SHADER_BINARY_FORMATS 0x8DF8
#define GR_GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
/* Shader Precision-Specified Types */
#define GR_GL_LOW_FLOAT 0x8DF0
#define GR_GL_MEDIUM_FLOAT 0x8DF1
#define GR_GL_HIGH_FLOAT 0x8DF2
#define GR_GL_LOW_INT 0x8DF3
#define GR_GL_MEDIUM_INT 0x8DF4
#define GR_GL_HIGH_INT 0x8DF5
/* Framebuffer Object. */
#define GR_GL_FRAMEBUFFER 0x8D40
#define GR_GL_READ_FRAMEBUFFER 0x8CA8
#define GR_GL_DRAW_FRAMEBUFFER 0x8CA9
#define GR_GL_RENDERBUFFER 0x8D41
#define GR_GL_RGBA4 0x8056
#define GR_GL_RGB5_A1 0x8057
#define GR_GL_RGB565 0x8D62
#define GR_GL_RGBA8 0x8058
#define GR_GL_DEPTH_COMPONENT16 0x81A5
#define GR_GL_STENCIL_INDEX 0x1901
#define GR_GL_STENCIL_INDEX4 0x8D47
#define GR_GL_STENCIL_INDEX8 0x8D48
#define GR_GL_STENCIL_INDEX16 0x8D49
#define GR_GL_DEPTH_STENCIL 0x84F9
#define GR_GL_DEPTH24_STENCIL8 0x88F0
#define GR_GL_MAX_SAMPLES 0x8D57
#define GR_GL_RENDERBUFFER_WIDTH 0x8D42
#define GR_GL_RENDERBUFFER_HEIGHT 0x8D43
#define GR_GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
#define GR_GL_RENDERBUFFER_RED_SIZE 0x8D50
#define GR_GL_RENDERBUFFER_GREEN_SIZE 0x8D51
#define GR_GL_RENDERBUFFER_BLUE_SIZE 0x8D52
#define GR_GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
#define GR_GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
#define GR_GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
#define GR_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
#define GR_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
#define GR_GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
#define GR_GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
#define GR_GL_COLOR_ATTACHMENT0 0x8CE0
#define GR_GL_DEPTH_ATTACHMENT 0x8D00
#define GR_GL_STENCIL_ATTACHMENT 0x8D20
#define GR_GL_DEPTH_STENCIL_ATTACHMENT 0x821A
#define GR_GL_NONE 0
#define GR_GL_FRAMEBUFFER_COMPLETE 0x8CD5
#define GR_GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
#define GR_GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
#define GR_GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
#define GR_GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
#define GR_GL_FRAMEBUFFER_BINDING 0x8CA6
#define GR_GL_RENDERBUFFER_BINDING 0x8CA7
#define GR_GL_MAX_RENDERBUFFER_SIZE 0x84E8
#define GR_GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
#endif

View File

@ -0,0 +1,81 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrGLIRect_DEFINED
#define GrGLIRect_DEFINED
#include "GrGLInterface.h"
/**
* Helper struct for dealing with the fact that Ganesh and GL use different
* window coordinate systems (top-down vs bottom-up)
*/
struct GrGLIRect {
GrGLint fLeft;
GrGLint fBottom;
GrGLsizei fWidth;
GrGLsizei fHeight;
void pushToGLViewport() const {
GR_GL(Viewport(fLeft, fBottom, fWidth, fHeight));
}
void pushToGLScissor() const {
GR_GL(Scissor(fLeft, fBottom, fWidth, fHeight));
}
void setFromGLViewport() {
GR_STATIC_ASSERT(sizeof(GrGLIRect) == 4*sizeof(GrGLint));
GR_GL_GetIntegerv(GR_GL_VIEWPORT, (GrGLint*) this);
}
// sometimes we have a GrIRect from the client that we
// want to simultaneously make relative to GL's viewport
// and convert from top-down to bottom-up.
void setRelativeTo(const GrGLIRect& glRect,
int leftOffset,
int topOffset,
int width,
int height) {
fLeft = glRect.fLeft + leftOffset;
fWidth = width;
fBottom = glRect.fBottom + (glRect.fHeight - topOffset - height);
fHeight = height;
GrAssert(fLeft >= 0);
GrAssert(fWidth >= 0);
GrAssert(fBottom >= 0);
GrAssert(fHeight >= 0);
}
bool contains(const GrGLIRect& glRect) const {
return fLeft <= glRect.fLeft &&
fBottom <= glRect.fBottom &&
fLeft + fWidth >= glRect.fLeft + glRect.fWidth &&
fBottom + fHeight >= glRect.fBottom + glRect.fHeight;
}
void invalidate() {fLeft = fWidth = fBottom = fHeight = -1;}
bool operator ==(const GrGLIRect& glRect) const {
return 0 == memcmp(this, &glRect, sizeof(GrGLIRect));
}
bool operator !=(const GrGLIRect& glRect) const {return !(*this == glRect);}
};
#endif

View File

@ -0,0 +1,64 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrGLIndexBuffer_DEFINED
#define GrGLIndexBuffer_DEFINED
#include "GrIndexBuffer.h"
#include "GrGLInterface.h"
class GrGpuGL;
class GrGLIndexBuffer : public GrIndexBuffer {
public:
virtual ~GrGLIndexBuffer() { this->release(); }
GrGLuint bufferID() const;
// overrides of GrIndexBuffer
virtual void* lock();
virtual void* lockPtr() const;
virtual void unlock();
virtual bool isLocked() const;
virtual bool updateData(const void* src, size_t srcSizeInBytes);
virtual bool updateSubData(const void* src,
size_t srcSizeInBytes,
size_t offset);
protected:
GrGLIndexBuffer(GrGpuGL* gpu,
GrGLuint id,
size_t sizeInBytes,
bool dynamic);
// overrides of GrResource
virtual void onAbandon();
virtual void onRelease();
private:
void bind() const;
GrGLuint fBufferID;
void* fLockPtr;
friend class GrGpuGL;
typedef GrIndexBuffer INHERITED;
};
#endif

View File

@ -0,0 +1,498 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrGLInterface_DEFINED
#define GrGLInterface_DEFINED
#include "GrGLConfig.h"
#include "GrTypes.h"
#if !defined(GR_GL_FUNCTION_TYPE)
#define GR_GL_FUNCTION_TYPE
#endif
////////////////////////////////////////////////////////////////////////////////
/**
* Helpers for glGetString()
*/
void gl_version_from_string(int* major, int* minor,
const char* versionString);
bool has_gl_extension_from_string(const char* ext,
const char* extensionString);
bool has_gl_extension(const char* ext);
void gl_version(int* major, int* minor);
////////////////////////////////////////////////////////////////////////////////
/*
* Routines managing the global interface used to invoke OpenGL calls.
*/
struct GrGLInterface;
GR_API GrGLInterface* GrGLGetGLInterface();
GR_API void GrGLSetGLInterface(GrGLInterface* gl_interface);
/*
* This is called when GrGLSetGLInterface() hasn't been called before creating
* a GrGpuGL object. It provides a default implementation. The actual
* implementation depends on which GrGLDefaultInterface_*.cpp has been linked.
* There are some platform-specific implementations provided as well as
* GrGLDefaultInterface_none.cpp which does nothing (effectively requiring an
* explicit GrGLSetGLInterface call by the host).
*/
void GrGLSetDefaultGLInterface();
typedef unsigned int GrGLenum;
typedef unsigned char GrGLboolean;
typedef unsigned int GrGLbitfield;
typedef signed char GrGLbyte;
typedef char GrGLchar;
typedef short GrGLshort;
typedef int GrGLint;
typedef int GrGLsizei;
typedef unsigned char GrGLubyte;
typedef unsigned short GrGLushort;
typedef unsigned int GrGLuint;
typedef float GrGLfloat;
typedef float GrGLclampf;
typedef double GrGLdouble;
typedef double GrGLclampd;
typedef void GrGLvoid;
typedef long GrGLintptr;
typedef long GrGLsizeiptr;
typedef char GrGLchar;
enum GrGLBinding {
kDesktop_GrGLBinding = 0x01,
kES1_GrGLBinding = 0x02,
kES2_GrGLBinding = 0x04
};
extern "C" {
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLActiveTextureProc)(GrGLenum texture);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLAttachShaderProc)(GrGLuint program, GrGLuint shader);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindAttribLocationProc)(GrGLuint program, GrGLuint index, const char* name);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindBufferProc)(GrGLenum target, GrGLuint buffer);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindTextureProc)(GrGLenum target, GrGLuint texture);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBlendColorProc)(GrGLclampf red, GrGLclampf green, GrGLclampf blue, GrGLclampf alpha);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBlendFuncProc)(GrGLenum sfactor, GrGLenum dfactor);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBufferDataProc)(GrGLenum target, GrGLsizeiptr size, const GrGLvoid* data, GrGLenum usage);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBufferSubDataProc)(GrGLenum target, GrGLintptr offset, GrGLsizeiptr size, const GrGLvoid* data);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLClearProc)(GrGLbitfield mask);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLClearColorProc)(GrGLclampf red, GrGLclampf green, GrGLclampf blue, GrGLclampf alpha);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLClearStencilProc)(GrGLint s);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLClientActiveTextureProc)(GrGLenum texture);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLColor4ubProc)(GrGLubyte red, GrGLubyte green, GrGLubyte blue, GrGLubyte alpha);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLColorMaskProc)(GrGLboolean red, GrGLboolean green, GrGLboolean blue, GrGLboolean alpha);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLColorPointerProc)(GrGLint size, GrGLenum type, GrGLsizei stride, const GrGLvoid* pointer);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLCompileShaderProc)(GrGLuint shader);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLCompressedTexImage2DProc)(GrGLenum target, GrGLint level, GrGLenum internalformat, GrGLsizei width, GrGLsizei height, GrGLint border, GrGLsizei imageSize, const GrGLvoid* data);
typedef GrGLuint (GR_GL_FUNCTION_TYPE *GrGLCreateProgramProc)(void);
typedef GrGLuint (GR_GL_FUNCTION_TYPE *GrGLCreateShaderProc)(GrGLenum type);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLCullFaceProc)(GrGLenum mode);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteBuffersProc)(GrGLsizei n, const GrGLuint* buffers);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteProgramProc)(GrGLuint program);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteShaderProc)(GrGLuint shader);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteTexturesProc)(GrGLsizei n, const GrGLuint* textures);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDepthMaskProc)(GrGLboolean flag);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDisableProc)(GrGLenum cap);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDisableClientStateProc)(GrGLenum array);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDisableVertexAttribArrayProc)(GrGLuint index);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDrawArraysProc)(GrGLenum mode, GrGLint first, GrGLsizei count);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDrawElementsProc)(GrGLenum mode, GrGLsizei count, GrGLenum type, const GrGLvoid* indices);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLEnableProc)(GrGLenum cap);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLEnableClientStateProc)(GrGLenum cap);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLEnableVertexAttribArrayProc)(GrGLuint index);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFrontFaceProc)(GrGLenum mode);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenBuffersProc)(GrGLsizei n, GrGLuint* buffers);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenTexturesProc)(GrGLsizei n, GrGLuint* textures);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetBufferParameterivProc)(GrGLenum target, GrGLenum pname, GrGLint* params);
typedef GrGLenum (GR_GL_FUNCTION_TYPE *GrGLGetErrorProc)(void);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetIntegervProc)(GrGLenum pname, GrGLint* params);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetProgramInfoLogProc)(GrGLuint program, GrGLsizei bufsize, GrGLsizei* length, char* infolog);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetProgramivProc)(GrGLuint program, GrGLenum pname, GrGLint* params);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetShaderInfoLogProc)(GrGLuint shader, GrGLsizei bufsize, GrGLsizei* length, char* infolog);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetShaderivProc)(GrGLuint shader, GrGLenum pname, GrGLint* params);
typedef const GrGLubyte* (GR_GL_FUNCTION_TYPE *GrGLGetStringProc)(GrGLenum name);
typedef GrGLint (GR_GL_FUNCTION_TYPE *GrGLGetUniformLocationProc)(GrGLuint program, const char* name);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLLineWidthProc)(GrGLfloat width);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLLinkProgramProc)(GrGLuint program);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLLoadMatrixfProc)(const GrGLfloat* m);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLMatrixModeProc)(GrGLenum mode);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLPixelStoreiProc)(GrGLenum pname, GrGLint param);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLPointSizeProc)(GrGLfloat size);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLReadPixelsProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, GrGLvoid* pixels);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLScissorProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLShadeModelProc)(GrGLenum mode);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLShaderSourceProc)(GrGLuint shader, GrGLsizei count, const char** str, const GrGLint* length);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilFuncProc)(GrGLenum func, GrGLint ref, GrGLuint mask);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilFuncSeparateProc)(GrGLenum face, GrGLenum func, GrGLint ref, GrGLuint mask);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilMaskProc)(GrGLuint mask);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilMaskSeparateProc)(GrGLenum face, GrGLuint mask);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilOpProc)(GrGLenum fail, GrGLenum zfail, GrGLenum zpass);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilOpSeparateProc)(GrGLenum face, GrGLenum fail, GrGLenum zfail, GrGLenum zpass);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexCoordPointerProc)(GrGLint size, GrGLenum type, GrGLsizei stride, const GrGLvoid* pointer);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexEnviProc)(GrGLenum target, GrGLenum pname, GrGLint param);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexImage2DProc)(GrGLenum target, GrGLint level, GrGLint internalformat, GrGLsizei width, GrGLsizei height, GrGLint border, GrGLenum format, GrGLenum type, const GrGLvoid* pixels);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexParameteriProc)(GrGLenum target, GrGLenum pname, GrGLint param);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexSubImage2DProc)(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, const GrGLvoid* pixels);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1fProc)(GrGLint location, GrGLfloat v0);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1iProc)(GrGLint location, GrGLint v0);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2fProc)(GrGLint location, GrGLfloat v0, GrGLfloat v1);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2iProc)(GrGLint location, GrGLint v0, GrGLint v1);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3fProc)(GrGLint location, GrGLfloat v0, GrGLfloat v1, GrGLfloat v2);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3iProc)(GrGLint location, GrGLint v0, GrGLint v1, GrGLint v2);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4fProc)(GrGLint location, GrGLfloat v0, GrGLfloat v1, GrGLfloat v2, GrGLfloat v3);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4iProc)(GrGLint location, GrGLint v0, GrGLint v1, GrGLint v2, GrGLint v3);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniformMatrix2fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniformMatrix3fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniformMatrix4fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUseProgramProc)(GrGLuint program);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexAttrib4fvProc)(GrGLuint indx, const GrGLfloat* values);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexAttribPointerProc)(GrGLuint indx, GrGLint size, GrGLenum type, GrGLboolean normalized, GrGLsizei stride, const GrGLvoid* ptr);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexPointerProc)(GrGLint size, GrGLenum type, GrGLsizei stride, const GrGLvoid* pointer);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLViewportProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height);
// FBO Extension Functions
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindFramebufferProc)(GrGLenum target, GrGLuint framebuffer);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindRenderbufferProc)(GrGLenum target, GrGLuint renderbuffer);
typedef GrGLenum (GR_GL_FUNCTION_TYPE *GrGLCheckFramebufferStatusProc)(GrGLenum target);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteFramebuffersProc)(GrGLsizei n, const GrGLuint *framebuffers);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteRenderbuffersProc)(GrGLsizei n, const GrGLuint *renderbuffers);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFramebufferRenderbufferProc)(GrGLenum target, GrGLenum attachment, GrGLenum renderbuffertarget, GrGLuint renderbuffer);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFramebufferTexture2DProc)(GrGLenum target, GrGLenum attachment, GrGLenum textarget, GrGLuint texture, GrGLint level);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenFramebuffersProc)(GrGLsizei n, GrGLuint *framebuffers);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenRenderbuffersProc)(GrGLsizei n, GrGLuint *renderbuffers);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLRenderbufferStorageProc)(GrGLenum target, GrGLenum internalformat, GrGLsizei width, GrGLsizei height);
// Multisampling Extension Functions
// same prototype for ARB_FBO, EXT_FBO, GL 3.0, & Apple ES extension
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLRenderbufferStorageMultisampleProc)(GrGLenum target, GrGLsizei samples, GrGLenum internalformat, GrGLsizei width, GrGLsizei height);
// desktop: ext_fbo_blit, arb_fbo, gl 3.0
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBlitFramebufferProc)(GrGLint srcX0, GrGLint srcY0, GrGLint srcX1, GrGLint srcY1, GrGLint dstX0, GrGLint dstY0, GrGLint dstX1, GrGLint dstY1, GrGLbitfield mask, GrGLenum filter);
// IMG's ES extension
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFramebufferTexture2DMultisampleProc)(GrGLenum target, GrGLenum attachment, GrGLenum textarget, GrGLuint texture, GrGLint level, GrGLsizei samples);
// apple's es extension
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLResolveMultisampleFramebufferProc)();
// Buffer mapping (extension in ES).
typedef GrGLvoid* (GR_GL_FUNCTION_TYPE *GrGLMapBufferProc)(GrGLenum target, GrGLenum access);
typedef GrGLboolean (GR_GL_FUNCTION_TYPE *GrGLUnmapBufferProc)(GrGLenum target);
// Dual source blending
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindFragDataLocationIndexedProc)(GrGLuint program, GrGLuint colorNumber, GrGLuint index, const GrGLchar * name);
// Additional typedefs for GLES2
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBlendEquationProc)( GrGLenum target );
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBlendEquationSeparateProc)( GrGLenum modeRBG, GrGLenum modeAlpha );
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBlendFuncSeparateProc)(GrGLenum srcRGB, GrGLenum dstRGB, GrGLenum srcAlpha, GrGLenum dstAlpha);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLClearDepthfProc)(GrGLclampf depth);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLCompressedTexSubImage2DProc)(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLsizei imageSize, const GrGLvoid* data);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLCopyTexImage2DProc)(GrGLenum target, GrGLint level, GrGLenum internalformat, GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height, GrGLint border);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLCopyTexSubImage2DProc)(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDepthFuncProc)(GrGLenum func);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDepthRangefProc)(GrGLclampf zNear, GrGLclampf zFar);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDetachShaderProc)(GrGLuint program, GrGLuint shader);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFinishProc)();
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFlushProc)();
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenerateMipmapProc)(GrGLenum target);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetActiveAttribProc)(GrGLuint program, GrGLuint index, GrGLsizei bufsize, GrGLsizei* length, GrGLint* size, GrGLenum* type, GrGLchar* name);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetActiveUniformProc)(GrGLuint program, GrGLuint index, GrGLsizei bufsize, GrGLsizei* length, GrGLint* size, GrGLenum* type, GrGLchar* name);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetAttachedShadersProc)(GrGLuint program, GrGLsizei maxcount, GrGLsizei* count, GrGLuint* shaders);
typedef GrGLint (GR_GL_FUNCTION_TYPE *GrGLGetAttribLocationProc)(GrGLuint program, const GrGLchar* name);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetBooleanvProc)(GrGLenum pname, GrGLboolean* params);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetFloatvProc)(GrGLenum pname, GrGLfloat* params);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetFramebufferAttachmentParameterivProc)(GrGLenum target, GrGLenum attachment, GrGLenum pname, GrGLint* params);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetRenderbufferParameterivProc)(GrGLenum target, GrGLenum pname, GrGLint* params);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetShaderPrecisionFormatProc)(GrGLenum shadertype, GrGLenum precisiontype, GrGLint* range, GrGLint* precision);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetShaderSourceProc)(GrGLuint shader, GrGLsizei bufsize, GrGLsizei* length, GrGLchar* source);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetTexParameterfvProc)(GrGLenum target, GrGLenum pname, GrGLfloat* params);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetTexParameterivProc)(GrGLenum target, GrGLenum pname, GrGLint* params);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetUniformfvProc)(GrGLuint program, GrGLint location, GrGLfloat* params);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetUniformivProc)(GrGLuint program, GrGLint location, GrGLint* params);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetVertexAttribfvProc)(GrGLuint index, GrGLenum pname, GrGLfloat* params);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetVertexAttribivProc)(GrGLuint index, GrGLenum pname, GrGLint* params);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetVertexAttribPointervProc)(GrGLuint index, GrGLenum pname, GrGLvoid** pointer);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLHintProc)(GrGLenum target, GrGLenum mode);
typedef GrGLboolean (GR_GL_FUNCTION_TYPE *GrGLIsBufferProc)(GrGLuint buffer);
typedef GrGLboolean (GR_GL_FUNCTION_TYPE *GrGLIsEnabledProc)(GrGLenum cap);
typedef GrGLboolean(GR_GL_FUNCTION_TYPE *GrGLIsFramebufferProc)(GrGLuint framebuffer);
typedef GrGLboolean (GR_GL_FUNCTION_TYPE *GrGLIsProgramProc)(GrGLuint program);
typedef GrGLboolean (GR_GL_FUNCTION_TYPE *GrGLfIsRenderbufferProc)(GrGLuint renderbuffer);
typedef GrGLboolean (GR_GL_FUNCTION_TYPE *GrGLIsShaderProc)(GrGLuint shader);
typedef GrGLboolean (GR_GL_FUNCTION_TYPE *GrGLIsTextureProc)(GrGLuint texture);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLPolygonOffsetProc)(GrGLfloat factor, GrGLfloat units);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLReleaseShaderCompilerProc)();
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLSampleCoverageProc)(GrGLclampf value, GrGLboolean invert);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLShaderBinaryProc)(GrGLsizei n, const GrGLuint* shaders, GrGLenum binaryformat, const GrGLvoid* binary, GrGLsizei length);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexParameterfProc)(GrGLenum target, GrGLenum pname, GrGLfloat param);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexParameterfvProc)(GrGLenum target, GrGLenum pname, const GrGLfloat* params);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexParameterivProc)(GrGLenum target, GrGLenum pname, const GrGLint* params);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1fProc)(GrGLint location, GrGLfloat x);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2fProc)(GrGLint location, GrGLfloat x, GrGLfloat y);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2iProc)(GrGLint location, GrGLint x, GrGLint y);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3fProc)(GrGLint location, GrGLfloat x, GrGLfloat y, GrGLfloat z);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3iProc)(GrGLint location, GrGLint x, GrGLint y, GrGLint z);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4fProc)(GrGLint location, GrGLfloat x, GrGLfloat y, GrGLfloat z, GrGLfloat w);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4iProc)(GrGLint location, GrGLint x, GrGLint y, GrGLint z, GrGLint w);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniformMatrix2fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniformMatrix4fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLValidateProgramProc)(GrGLuint program);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexAttrib1fProc)(GrGLuint indx, GrGLfloat x);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexAttrib1fvProc)(GrGLuint indx, const GrGLfloat* values);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexAttrib2fProc)(GrGLuint indx, GrGLfloat x, GrGLfloat y);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexAttrib2fvProc)(GrGLuint indx, const GrGLfloat* values);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexAttrib3fProc)(GrGLuint indx, GrGLfloat x, GrGLfloat y, GrGLfloat z);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexAttrib3fvProc)(GrGLuint indx, const GrGLfloat* values);
typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexAttrib4fProc)(GrGLuint indx, GrGLfloat x, GrGLfloat y, GrGLfloat z, GrGLfloat w);
} // extern "C"
enum GrGLCapability {
kProbe_GrGLCapability = -1
};
/*
* The following interface exports the OpenGL entry points used by the system.
* Use of OpenGL calls is disallowed. All calls should be invoked through
* the global instance of this struct, defined above.
*
* IMPORTANT NOTE: The OpenGL entry points exposed here include both core GL
* functions, and extensions. The system assumes that the address of the
* extension pointer will be valid across contexts.
*/
struct GrGLInterface {
bool validate(GrEngine engine) const;
// Indicator variable specifying the type of GL implementation
// exported: GLES{1|2} or Desktop.
GrGLBinding fBindingsExported;
/// Does this GL support NPOT textures on FBOs?
/// boolean value, or kProbe_GrGLCapability to probe (slowly) at context creation.
int fNPOTRenderTargetSupport;
/// Some GL implementations (PowerVR SGX devices like the iPhone 4)
/// have restrictions on the size of small render targets.
/// kProbe_GrGLCapability to probe (slowly) at context creation.
int fMinRenderTargetHeight;
int fMinRenderTargetWidth;
GrGLActiveTextureProc fActiveTexture;
GrGLAttachShaderProc fAttachShader;
GrGLBindAttribLocationProc fBindAttribLocation;
GrGLBindBufferProc fBindBuffer;
GrGLBindTextureProc fBindTexture;
GrGLBlendColorProc fBlendColor;
GrGLBlendFuncProc fBlendFunc;
GrGLBufferDataProc fBufferData;
GrGLBufferSubDataProc fBufferSubData;
GrGLClearProc fClear;
GrGLClearColorProc fClearColor;
GrGLClearStencilProc fClearStencil;
GrGLClientActiveTextureProc fClientActiveTexture;
GrGLColor4ubProc fColor4ub;
GrGLColorMaskProc fColorMask;
GrGLColorPointerProc fColorPointer;
GrGLCompileShaderProc fCompileShader;
GrGLCompressedTexImage2DProc fCompressedTexImage2D;
GrGLCreateProgramProc fCreateProgram;
GrGLCreateShaderProc fCreateShader;
GrGLCullFaceProc fCullFace;
GrGLDeleteBuffersProc fDeleteBuffers;
GrGLDeleteProgramProc fDeleteProgram;
GrGLDeleteShaderProc fDeleteShader;
GrGLDeleteTexturesProc fDeleteTextures;
GrGLDepthMaskProc fDepthMask;
GrGLDisableProc fDisable;
GrGLDisableClientStateProc fDisableClientState;
GrGLDisableVertexAttribArrayProc fDisableVertexAttribArray;
GrGLDrawArraysProc fDrawArrays;
GrGLDrawElementsProc fDrawElements;
GrGLEnableProc fEnable;
GrGLEnableClientStateProc fEnableClientState;
GrGLEnableVertexAttribArrayProc fEnableVertexAttribArray;
GrGLFrontFaceProc fFrontFace;
GrGLGenBuffersProc fGenBuffers;
GrGLGenTexturesProc fGenTextures;
GrGLGetBufferParameterivProc fGetBufferParameteriv;
GrGLGetErrorProc fGetError;
GrGLGetIntegervProc fGetIntegerv;
GrGLGetProgramInfoLogProc fGetProgramInfoLog;
GrGLGetProgramivProc fGetProgramiv;
GrGLGetShaderInfoLogProc fGetShaderInfoLog;
GrGLGetShaderivProc fGetShaderiv;
GrGLGetStringProc fGetString;
GrGLGetUniformLocationProc fGetUniformLocation;
GrGLLineWidthProc fLineWidth;
GrGLLinkProgramProc fLinkProgram;
GrGLLoadMatrixfProc fLoadMatrixf;
GrGLMatrixModeProc fMatrixMode;
GrGLPixelStoreiProc fPixelStorei;
GrGLPointSizeProc fPointSize;
GrGLReadPixelsProc fReadPixels;
GrGLScissorProc fScissor;
GrGLShadeModelProc fShadeModel;
GrGLShaderSourceProc fShaderSource;
GrGLStencilFuncProc fStencilFunc;
GrGLStencilFuncSeparateProc fStencilFuncSeparate;
GrGLStencilMaskProc fStencilMask;
GrGLStencilMaskSeparateProc fStencilMaskSeparate;
GrGLStencilOpProc fStencilOp;
GrGLStencilOpSeparateProc fStencilOpSeparate;
GrGLTexCoordPointerProc fTexCoordPointer;
GrGLTexEnviProc fTexEnvi;
GrGLTexImage2DProc fTexImage2D;
GrGLTexParameteriProc fTexParameteri;
GrGLTexSubImage2DProc fTexSubImage2D;
GrGLUniform1fProc fUniform1f;
GrGLUniform1iProc fUniform1i;
GrGLUniform1fvProc fUniform1fv;
GrGLUniform1ivProc fUniform1iv;
GrGLUniform2fProc fUniform2f;
GrGLUniform2iProc fUniform2i;
GrGLUniform2fvProc fUniform2fv;
GrGLUniform2ivProc fUniform2iv;
GrGLUniform3fProc fUniform3f;
GrGLUniform3iProc fUniform3i;
GrGLUniform3fvProc fUniform3fv;
GrGLUniform3ivProc fUniform3iv;
GrGLUniform4fProc fUniform4f;
GrGLUniform4iProc fUniform4i;
GrGLUniform4fvProc fUniform4fv;
GrGLUniform4ivProc fUniform4iv;
GrGLUniformMatrix2fvProc fUniformMatrix2fv;
GrGLUniformMatrix3fvProc fUniformMatrix3fv;
GrGLUniformMatrix4fvProc fUniformMatrix4fv;
GrGLUseProgramProc fUseProgram;
GrGLVertexAttrib4fvProc fVertexAttrib4fv;
GrGLVertexAttribPointerProc fVertexAttribPointer;
GrGLVertexPointerProc fVertexPointer;
GrGLViewportProc fViewport;
// Additional Bindings for GLES2
GrGLBlendEquationProc fBlendEquation;
GrGLBlendEquationSeparateProc fBlendEquationSeparate;
GrGLBlendFuncSeparateProc fBlendFuncSeparate;
GrGLClearDepthfProc fClearDepthf;
GrGLCompressedTexSubImage2DProc fCompressedTexSubImage2D;
GrGLCopyTexImage2DProc fCopyTexImage2D;
GrGLCopyTexSubImage2DProc fCopyTexSubImage2D;
GrGLDepthFuncProc fDepthFunc;
GrGLDepthRangefProc fDepthRangef;
GrGLDetachShaderProc fDetachShader;
GrGLFinishProc fFinish;
GrGLFlushProc fFlush;
GrGLGenerateMipmapProc fGenerateMipmap;
GrGLGetActiveAttribProc fGetActiveAttrib;
GrGLGetActiveUniformProc fGetActiveUniform;
GrGLGetAttachedShadersProc fGetAttachedShaders;
GrGLGetAttribLocationProc fGetAttribLocation;
GrGLGetBooleanvProc fGetBooleanv;
GrGLGetFloatvProc fGetFloatv;
GrGLGetFramebufferAttachmentParameterivProc fGetFramebufferAttachmentParameteriv;
GrGLGetRenderbufferParameterivProc fGetRenderbufferParameteriv;
GrGLGetShaderPrecisionFormatProc fGetShaderPrecisionFormat;
GrGLGetShaderSourceProc fGetShaderSource;
GrGLGetTexParameterfvProc fGetTexParameterfv;
GrGLGetTexParameterivProc fGetTexParameteriv;
GrGLGetUniformfvProc fGetUniformfv;
GrGLGetUniformivProc fGetUniformiv;
GrGLGetVertexAttribfvProc fGetVertexAttribfv;
GrGLGetVertexAttribivProc fGetVertexAttribiv;
GrGLGetVertexAttribPointervProc fGetVertexAttribPointerv;
GrGLHintProc fHint;
GrGLIsBufferProc fIsBuffer;
GrGLIsEnabledProc fIsEnabled;
GrGLIsFramebufferProc fIsFramebuffer;
GrGLIsProgramProc fIsProgram;
GrGLfIsRenderbufferProc fIsRenderbuffer;
GrGLIsShaderProc fIsShader;
GrGLIsTextureProc fIsTexture;
GrGLPolygonOffsetProc fPolygonOffset;
GrGLReleaseShaderCompilerProc fReleaseShaderCompiler;
GrGLSampleCoverageProc fSampleCoverage;
GrGLShaderBinaryProc fShaderBinary;
GrGLTexParameterfProc fTexParameterf;
GrGLTexParameterfvProc fTexParameterfv;
GrGLTexParameterivProc fTexParameteriv;
GrGLValidateProgramProc fValidateProgram;
GrGLVertexAttrib1fProc fVertexAttrib1f;
GrGLVertexAttrib1fvProc fVertexAttrib1fv;
GrGLVertexAttrib2fProc fVertexAttrib2f;
GrGLVertexAttrib2fvProc fVertexAttrib2fv;
GrGLVertexAttrib3fProc fVertexAttrib3f;
GrGLVertexAttrib3fvProc fVertexAttrib3fv;
GrGLVertexAttrib4fProc fVertexAttrib4f;
// FBO Extension Functions
GrGLBindFramebufferProc fBindFramebuffer;
GrGLBindRenderbufferProc fBindRenderbuffer;
GrGLCheckFramebufferStatusProc fCheckFramebufferStatus;
GrGLDeleteFramebuffersProc fDeleteFramebuffers;
GrGLDeleteRenderbuffersProc fDeleteRenderbuffers;
GrGLFramebufferRenderbufferProc fFramebufferRenderbuffer;
GrGLFramebufferTexture2DProc fFramebufferTexture2D;
GrGLGenFramebuffersProc fGenFramebuffers;
GrGLGenRenderbuffersProc fGenRenderbuffers;
GrGLRenderbufferStorageProc fRenderbufferStorage;
// Multisampling Extension Functions
// same prototype for ARB_FBO, EXT_FBO, GL 3.0, & Apple ES extension
GrGLRenderbufferStorageMultisampleProc fRenderbufferStorageMultisample;
// desktop: ext_fbo_blit, arb_fbo, gl 3.0
GrGLBlitFramebufferProc fBlitFramebuffer;
// IMG's ES extension
GrGLFramebufferTexture2DMultisampleProc fFramebufferTexture2DMultisample;
// apple's es extension
GrGLResolveMultisampleFramebufferProc fResolveMultisampleFramebuffer;
// Buffer mapping (extension in ES).
GrGLMapBufferProc fMapBuffer;
GrGLUnmapBufferProc fUnmapBuffer;
// Dual Source Blending
GrGLBindFragDataLocationIndexedProc fBindFragDataLocationIndexed;
// Code that initializes this struct using a static initializer should
// make this the last entry in the static initializer. It can help to guard
// against failing to initialize newly-added members of this struct.
enum { kStaticInitEndGuard } fStaticInitEndGuard;
private:
bool validateShaderFunctions() const;
bool validateFixedFunctions() const;
};
#endif

View File

@ -0,0 +1,300 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrGLProgram_DEFINED
#define GrGLProgram_DEFINED
#include "GrGLInterface.h"
#include "GrSamplerState.h"
#include "GrStringBuilder.h"
#include "GrGpu.h"
#include "SkXfermode.h"
class GrBinHashKeyBuilder;
struct ShaderCodeSegments {
GrStringBuilder fHeader; // VS+FS, GLSL version, etc
GrStringBuilder fVSUnis;
GrStringBuilder fVSAttrs;
GrStringBuilder fVaryings;
GrStringBuilder fFSUnis;
GrStringBuilder fFSOutputs;
GrStringBuilder fFSFunctions;
GrStringBuilder fVSCode;
GrStringBuilder fFSCode;
};
/**
* This class manages a GPU program and records per-program information.
* We can specify the attribute locations so that they are constant
* across our shaders. But the driver determines the uniform locations
* at link time. We don't need to remember the sampler uniform location
* because we will bind a texture slot to it and never change it
* Uniforms are program-local so we can't rely on fHWState to hold the
* previous uniform state after a program change.
*/
class GrGLProgram {
public:
class CachedData;
GrGLProgram();
~GrGLProgram();
/**
* Streams data that can uniquely identifies the generated
* gpu program into a key, for cache indexing purposes.
*
* @param key The key object to receive the key data
*/
void buildKey(GrBinHashKeyBuilder& key) const;
/**
* This is the heavy initilization routine for building a GLProgram.
* The result of heavy init is not stored in datamembers of GrGLProgam,
* but in a separate cacheable container.
*/
bool genProgram(CachedData* programData) const;
/**
* The shader may modify the blend coeffecients. Params are in/out
*/
void overrideBlend(GrBlendCoeff* srcCoeff, GrBlendCoeff* dstCoeff) const;
/**
* Attribute indices
*/
static int PositionAttributeIdx() { return 0; }
static int TexCoordAttributeIdx(int tcIdx) { return 1 + tcIdx; }
static int ColorAttributeIdx() { return 1 + GrDrawTarget::kMaxTexCoords; }
static int ViewMatrixAttributeIdx() {
return 2 + GrDrawTarget::kMaxTexCoords;
}
static int TextureMatrixAttributeIdx(int stage) {
return 5 + GrDrawTarget::kMaxTexCoords + 3 * stage;
}
private:
// Parameters that affect code generation
// These structs should be kept compact; they are the input to an
// expensive hash key generator.
struct ProgramDesc {
ProgramDesc() {
// since we use this as part of a key we can't have any unitialized
// padding
memset(this, 0, sizeof(ProgramDesc));
}
struct StageDesc {
enum OptFlagBits {
kNoPerspective_OptFlagBit = 1 << 0,
kIdentityMatrix_OptFlagBit = 1 << 1,
kCustomTextureDomain_OptFlagBit = 1 << 2,
kIsEnabled_OptFlagBit = 1 << 7
};
enum Modulation {
kColor_Modulation,
kAlpha_Modulation
};
enum FetchMode {
kSingle_FetchMode,
k2x2_FetchMode
};
enum CoordMapping {
kIdentity_CoordMapping,
kRadialGradient_CoordMapping,
kSweepGradient_CoordMapping,
kRadial2Gradient_CoordMapping
};
uint8_t fOptFlags;
uint8_t fModulation; // casts to enum Modulation
uint8_t fFetchMode; // casts to enum FetchMode
uint8_t fCoordMapping; // casts to enum CoordMapping
inline bool isEnabled() const {
return fOptFlags & kIsEnabled_OptFlagBit;
}
inline void setEnabled(bool newValue) {
if (newValue) {
fOptFlags |= kIsEnabled_OptFlagBit;
} else {
fOptFlags &= ~kIsEnabled_OptFlagBit;
}
}
uint8_t fWrapModeHorizontal; // casts to enum GrSamplerState::WrapMode
uint8_t fWrapModeVertical;
};
enum ColorType {
kNone_ColorType = 0,
kAttribute_ColorType = 1,
kUniform_ColorType = 2,
};
// Dual-src blending makes use of a secondary output color that can be
// used as a per-pixel blend coeffecient. This controls whether a
// secondary source is output and what value it holds.
enum DualSrcOutput {
kNone_DualSrcOutput,
kCoverage_DualSrcOutput,
kCoverageISA_DualSrcOutput,
kCoverageISC_DualSrcOutput,
kDualSrcOutputCnt
};
// stripped of bits that don't affect prog generation
GrVertexLayout fVertexLayout;
StageDesc fStages[GrDrawTarget::kNumStages];
uint8_t fColorType; // casts to enum ColorType
uint8_t fDualSrcOutput; // casts to enum DualSrcOutput
int8_t fFirstCoverageStage;
SkBool8 fEmitsPointSize;
SkBool8 fEdgeAAConcave;
int8_t fEdgeAANumEdges;
uint8_t fColorFilterXfermode; // casts to enum SkXfermode::Mode
uint8_t fPadTo32bLengthMultiple [1];
} fProgramDesc;
const ProgramDesc& getDesc() { return fProgramDesc; }
public:
enum {
kUnusedUniform = -1,
kSetAsAttribute = 1000,
};
struct StageUniLocations {
GrGLint fTextureMatrixUni;
GrGLint fNormalizedTexelSizeUni;
GrGLint fSamplerUni;
GrGLint fRadial2Uni;
GrGLint fTexDomUni;
void reset() {
fTextureMatrixUni = kUnusedUniform;
fNormalizedTexelSizeUni = kUnusedUniform;
fSamplerUni = kUnusedUniform;
fRadial2Uni = kUnusedUniform;
fTexDomUni = kUnusedUniform;
}
};
struct UniLocations {
GrGLint fViewMatrixUni;
GrGLint fColorUni;
GrGLint fEdgesUni;
GrGLint fColorFilterUni;
StageUniLocations fStages[GrDrawTarget::kNumStages];
void reset() {
fViewMatrixUni = kUnusedUniform;
fColorUni = kUnusedUniform;
fEdgesUni = kUnusedUniform;
fColorFilterUni = kUnusedUniform;
for (int s = 0; s < GrDrawTarget::kNumStages; ++s) {
fStages[s].reset();
}
}
};
class CachedData : public ::GrNoncopyable {
public:
CachedData() {
}
~CachedData() {
}
void copyAndTakeOwnership(CachedData& other) {
memcpy(this, &other, sizeof(*this));
}
public:
// IDs
GrGLuint fVShaderID;
GrGLuint fFShaderID;
GrGLuint fProgramID;
// shader uniform locations (-1 if shader doesn't use them)
UniLocations fUniLocations;
GrMatrix fViewMatrix;
// these reflect the current values of uniforms
// (GL uniform values travel with program)
GrColor fColor;
GrColor fColorFilterColor;
GrMatrix fTextureMatrices[GrDrawTarget::kNumStages];
// width and height used for normalized texel size
int fTextureWidth[GrDrawTarget::kNumStages];
int fTextureHeight[GrDrawTarget::kNumStages];
GrScalar fRadial2CenterX1[GrDrawTarget::kNumStages];
GrScalar fRadial2Radius0[GrDrawTarget::kNumStages];
bool fRadial2PosRoot[GrDrawTarget::kNumStages];
GrRect fTextureDomain[GrDrawTarget::kNumStages];
private:
enum Constants {
kUniLocationPreAllocSize = 8
};
}; // CachedData
private:
enum {
kUseUniform = 2000
};
// should set all fields in locations var to kUseUniform if the
// corresponding uniform is required for the program.
void genStageCode(int stageNum,
const ProgramDesc::StageDesc& desc,
const char* fsInColor, // NULL means no incoming color
const char* fsOutColor,
const char* vsInCoord,
ShaderCodeSegments* segments,
StageUniLocations* locations) const;
static bool CompileFSAndVS(const ShaderCodeSegments& segments,
CachedData* programData);
// Compiles a GL shader, returns shader ID or 0 if failed
// params have same meaning as glShaderSource
static GrGLuint CompileShader(GrGLenum type, int stringCnt,
const char** strings,
int* stringLengths);
// Creates a GL program ID, binds shader attributes to GL vertex attrs, and
// links the program
bool bindOutputsAttribsAndLinkProgram(
GrStringBuilder texCoordAttrNames[GrDrawTarget::kMaxTexCoords],
bool bindColorOut,
bool bindDualSrcOut,
CachedData* programData) const;
// Gets locations for all uniforms set to kUseUniform and initializes cache
// to invalid values.
void getUniformLocationsAndInitCache(CachedData* programData) const;
friend class GrGpuGLShaders;
};
#endif

View File

@ -0,0 +1,243 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrGLTexture_DEFINED
#define GrGLTexture_DEFINED
#include "GrTexture.h"
#include "GrScalar.h"
#include "GrGLIRect.h"
class GrGpuGL;
class GrGLTexture;
/**
* A ref counted tex id that deletes the texture in its destructor.
*/
class GrGLTexID : public GrRefCnt {
public:
GrGLTexID(GrGLuint texID, bool ownsID) : fTexID(texID), fOwnsID(ownsID) {}
virtual ~GrGLTexID() {
if (0 != fTexID && fOwnsID) {
GR_GL(DeleteTextures(1, &fTexID));
}
}
void abandon() { fTexID = 0; }
GrGLuint id() const { return fTexID; }
private:
GrGLuint fTexID;
bool fOwnsID;
};
////////////////////////////////////////////////////////////////////////////////
class GrGLRenderTarget : public GrRenderTarget {
public:
// set fTexFBOID to this value to indicate that it is multisampled but
// Gr doesn't know how to resolve it.
enum { kUnresolvableFBOID = 0 };
struct GLRenderTargetIDs {
GrGLuint fRTFBOID;
GrGLuint fTexFBOID;
GrGLuint fStencilRenderbufferID;
GrGLuint fMSColorRenderbufferID;
bool fOwnIDs;
void reset() { memset(this, 0, sizeof(GLRenderTargetIDs)); }
};
GrGLRenderTarget(GrGpuGL* gpu,
const GLRenderTargetIDs& ids,
GrGLTexID* texID,
GrGLuint stencilBits,
bool isMultisampled,
const GrGLIRect& fViewport,
GrGLTexture* texture);
virtual ~GrGLRenderTarget() { this->release(); }
void setViewport(const GrGLIRect& rect) { fViewport = rect; }
const GrGLIRect& getViewport() const { return fViewport; }
// The following two functions return the same ID when a
// texture-rendertarget is multisampled, and different IDs when
// it is.
// FBO ID used to render into
GrGLuint renderFBOID() const { return fRTFBOID; }
// FBO ID that has texture ID attached.
GrGLuint textureFBOID() const { return fTexFBOID; }
// override of GrRenderTarget
virtual ResolveType getResolveType() const {
if (fRTFBOID == fTexFBOID) {
// catches FBO 0 and non MSAA case
return kAutoResolves_ResolveType;
} else if (kUnresolvableFBOID == fTexFBOID) {
return kCantResolve_ResolveType;
} else {
return kCanResolve_ResolveType;
}
}
protected:
// override of GrResource
virtual void onAbandon();
virtual void onRelease();
private:
GrGLuint fRTFBOID;
GrGLuint fTexFBOID;
GrGLuint fStencilRenderbufferID;
GrGLuint fMSColorRenderbufferID;
// Should this object delete IDs when it is destroyed or does someone
// else own them.
bool fOwnIDs;
// when we switch to this rendertarget we want to set the viewport to
// only render to to content area (as opposed to the whole allocation) and
// we want the rendering to be at top left (GL has origin in bottom left)
GrGLIRect fViewport;
// non-NULL if this RT was created by Gr with an associated GrGLTexture.
GrGLTexID* fTexIDObj;
typedef GrRenderTarget INHERITED;
};
////////////////////////////////////////////////////////////////////////////////
class GrGLTexture : public GrTexture {
public:
enum Orientation {
kBottomUp_Orientation,
kTopDown_Orientation,
};
struct TexParams {
GrGLenum fFilter;
GrGLenum fWrapS;
GrGLenum fWrapT;
bool fUseGpuRepeat;
void invalidate() { memset(this, 0xff, sizeof(TexParams)); }
};
struct GLTextureDesc {
int fContentWidth;
int fContentHeight;
int fAllocWidth;
int fAllocHeight;
GrPixelConfig fFormat;
GrGLuint fTextureID;
bool fOwnsID;
GrGLenum fUploadFormat;
GrGLenum fUploadByteCount;
GrGLenum fUploadType;
GrGLuint fStencilBits;
Orientation fOrientation;
};
typedef GrGLRenderTarget::GLRenderTargetIDs GLRenderTargetIDs;
GrGLTexture(GrGpuGL* gpu,
const GLTextureDesc& textureDesc,
const GLRenderTargetIDs& rtIDs,
const TexParams& initialTexParams);
virtual ~GrGLTexture() { this->release(); }
// overrides of GrTexture
virtual void uploadTextureData(int x,
int y,
int width,
int height,
const void* srcData);
virtual intptr_t getTextureHandle();
const TexParams& getTexParams() const { return fTexParams; }
void setTexParams(const TexParams& texParams) { fTexParams = texParams; }
GrGLuint textureID() const { return fTexIDObj->id(); }
GrGLenum uploadFormat() const { return fUploadFormat; }
GrGLenum uploadByteCount() const { return fUploadByteCount; }
GrGLenum uploadType() const { return fUploadType; }
/**
* Retrieves the texture width actually allocated in texels.
*
* @return the width in texels
*/
int allocWidth() const { return fAllocWidth; }
/**
* Retrieves the texture height actually allocated in texels.
*
* @return the height in texels
*/
int allocHeight() const { return fAllocHeight; }
/**
* @return width() / allocWidth()
*/
GrScalar contentScaleX() const { return fScaleX; }
/**
* @return height() / allocHeight()
*/
GrScalar contentScaleY() const { return fScaleY; }
// Ganesh assumes texture coordinates have their origin
// in the top-left corner of the image. OpenGL, however,
// has the origin in the lower-left corner. For content that
// is loaded by Ganesh we just push the content "upside down"
// (by GL's understanding of the world ) in glTex*Image and the
// addressing just works out. However, content generated by GL
// (FBO or externally imported texture) will be updside down
// and it is up to the GrGpuGL derivative to handle y-mirroing.
Orientation orientation() const { return fOrientation; }
static const GrGLenum* WrapMode2GLWrap();
protected:
// overrides of GrTexture
virtual void onAbandon();
virtual void onRelease();
private:
TexParams fTexParams;
GrGLTexID* fTexIDObj;
GrGLenum fUploadFormat;
GrGLenum fUploadByteCount;
GrGLenum fUploadType;
int fAllocWidth;
int fAllocHeight;
// precomputed content / alloc ratios
GrScalar fScaleX;
GrScalar fScaleY;
Orientation fOrientation;
GrGpuGL* fGpuGL;
typedef GrTexture INHERITED;
};
#endif

View File

@ -0,0 +1,62 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrGLVertexBuffer_DEFINED
#define GrGLVertexBuffer_DEFINED
#include "GrVertexBuffer.h"
#include "GrGLInterface.h"
class GrGpuGL;
class GrGLVertexBuffer : public GrVertexBuffer {
public:
virtual ~GrGLVertexBuffer() { this->release(); }
// overrides of GrVertexBuffer
virtual void* lock();
virtual void* lockPtr() const;
virtual void unlock();
virtual bool isLocked() const;
virtual bool updateData(const void* src, size_t srcSizeInBytes);
virtual bool updateSubData(const void* src,
size_t srcSizeInBytes,
size_t offset);
GrGLuint bufferID() const;
protected:
GrGLVertexBuffer(GrGpuGL* gpu,
GrGLuint id,
size_t sizeInBytes,
bool dynamic);
// overrides of GrResource
virtual void onAbandon();
virtual void onRelease();
private:
void bind() const;
GrGLuint fBufferID;
void* fLockPtr;
friend class GrGpuGL;
typedef GrVertexBuffer INHERITED;
};
#endif

View File

@ -0,0 +1,110 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrGeometryBuffer_DEFINED
#define GrGeometryBuffer_DEFINED
#include "GrResource.h"
class GrGpu;
/**
* Parent class for vertex and index buffers
*/
class GrGeometryBuffer : public GrResource {
public:
/**
* Retrieves the size of the buffer
*
* @return the size of the buffer in bytes
*/
size_t size() const { return fSizeInBytes; }
/**
*Retrieves whether the buffer was created with the dynamic flag
*
* @return true if the buffer was created with the dynamic flag
*/
bool dynamic() const { return fDynamic; }
/**
* Locks the buffer to be written by the CPU.
*
* The previous content of the buffer is invalidated. It is an error
* to draw from the buffer while it is locked. It is an error to call lock
* on an already locked buffer.
*
* @return a pointer to the data or NULL if the lock fails.
*/
virtual void* lock() = 0;
/**
* Returns the same ptr that lock() returned at time of lock or NULL if the
* is not locked.
*
* @return ptr to locked buffer data or undefined if buffer is not locked.
*/
virtual void* lockPtr() const = 0;
/**
* Unlocks the buffer.
*
* The pointer returned by the previous lock call will no longer be valid.
*/
virtual void unlock() = 0;
/**
Queries whether the buffer has been locked.
@return true if the buffer is locked, false otherwise.
*/
virtual bool isLocked() const = 0;
/**
* Updates the buffer data.
*
* The size of the buffer will be preserved. The src data will be
* placed at the begining of the buffer and any remaining contents will
* be undefined.
*
* @return returns true if the update succeeds, false otherwise.
*/
virtual bool updateData(const void* src, size_t srcSizeInBytes) = 0;
/**
* Updates a portion of the buffer data.
*
* The contents of the buffer outside the update region are preserved.
*
* @return returns true if the update succeeds, false otherwise.
*/
virtual bool updateSubData(const void* src,
size_t srcSizeInBytes,
size_t offset) = 0;
protected:
GrGeometryBuffer(GrGpu* gpu, size_t sizeInBytes, bool dynamic)
: INHERITED(gpu)
, fSizeInBytes(sizeInBytes)
, fDynamic(dynamic) {}
private:
size_t fSizeInBytes;
bool fDynamic;
typedef GrResource INHERITED;
};
#endif

View File

@ -0,0 +1,89 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrGlyph_DEFINED
#define GrGlyph_DEFINED
#include "GrPath.h"
#include "GrRect.h"
class GrAtlas;
/* Need this to be quad-state:
- complete w/ image
- just metrics
- failed to get image, but has metrics
- failed to get metrics
*/
struct GrGlyph {
typedef uint32_t PackedID;
GrAtlas* fAtlas;
GrPath* fPath;
PackedID fPackedID;
GrIRect16 fBounds;
GrIPoint16 fAtlasLocation;
void init(GrGlyph::PackedID packed, const GrIRect& bounds) {
fAtlas = NULL;
fPath = NULL;
fPackedID = packed;
fBounds.set(bounds);
fAtlasLocation.set(0, 0);
}
void free() {
if (fPath) {
delete fPath;
fPath = NULL;
}
}
int width() const { return fBounds.width(); }
int height() const { return fBounds.height(); }
bool isEmpty() const { return fBounds.isEmpty(); }
uint16_t glyphID() const { return UnpackID(fPackedID); }
///////////////////////////////////////////////////////////////////////////
static inline unsigned ExtractSubPixelBitsFromFixed(GrFixed pos) {
// two most significant fraction bits from fixed-point
return (pos >> 14) & 3;
}
static inline PackedID Pack(uint16_t glyphID, GrFixed x, GrFixed y) {
x = ExtractSubPixelBitsFromFixed(x);
y = ExtractSubPixelBitsFromFixed(y);
return (x << 18) | (y << 16) | glyphID;
}
static inline GrFixed UnpackFixedX(PackedID packed) {
return ((packed >> 18) & 3) << 14;
}
static inline GrFixed UnpackFixedY(PackedID packed) {
return ((packed >> 16) & 3) << 14;
}
static inline uint16_t UnpackID(PackedID packed) {
return (uint16_t)packed;
}
};
#endif

View File

@ -0,0 +1,563 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrGpu_DEFINED
#define GrGpu_DEFINED
#include "GrDrawTarget.h"
#include "GrPathRenderer.h"
#include "GrRect.h"
#include "GrRefCnt.h"
#include "GrTexture.h"
class GrContext;
class GrIndexBufferAllocPool;
class GrResource;
class GrVertexBufferAllocPool;
/**
* Gpu usage statistics.
*/
struct GrGpuStats {
uint32_t fVertexCnt; //<! Number of vertices drawn
uint32_t fIndexCnt; //<! Number of indices drawn
uint32_t fDrawCnt; //<! Number of draws
uint32_t fProgChngCnt;//<! Number of program changes (N/A for fixed)
/*
* Number of times the texture is set in 3D API
*/
uint32_t fTextureChngCnt;
/*
* Number of times the render target is set in 3D API
*/
uint32_t fRenderTargetChngCnt;
/*
* Number of textures created (includes textures that are rendertargets).
*/
uint32_t fTextureCreateCnt;
/*
* Number of rendertargets created.
*/
uint32_t fRenderTargetCreateCnt;
};
class GrGpu : public GrDrawTarget {
public:
/**
* Additional blend coeffecients for dual source blending, not exposed
* through GrPaint/GrContext.
*/
enum ExtendedBlendCoeffs {
// source 2 refers to second output color when
// using dual source blending.
kS2C_BlendCoeff = kPublicBlendCoeffCount,
kIS2C_BlendCoeff,
kS2A_BlendCoeff,
kIS2A_BlendCoeff,
kTotalBlendCoeffCount
};
/**
* Create an instance of GrGpu that matches the specified Engine backend.
* If the requested engine is not supported (at compile-time or run-time)
* this returns NULL.
*/
static GrGpu* Create(GrEngine, GrPlatform3DContext context3D);
////////////////////////////////////////////////////////////////////////////
GrGpu();
virtual ~GrGpu();
// The GrContext sets itself as the owner of this Gpu object
void setContext(GrContext* context) {
GrAssert(NULL == fContext);
fContext = context;
}
GrContext* getContext() { return fContext; }
const GrContext* getContext() const { return fContext; }
/**
* The GrGpu object normally assumes that no outsider is setting state
* within the underlying 3D API's context/device/whatever. This call informs
* the GrGpu that the state was modified and it shouldn't make assumptions
* about the state.
*/
void markContextDirty() { fContextIsDirty = true; }
void unimpl(const char[]);
/**
* Creates a texture object. If desc width or height is not a power of
* two but underlying API requires a power of two texture then srcData
* will be embedded in a power of two texture. The extra width and height
* is filled as though srcData were rendered clamped into the texture.
*
* If kRenderTarget_TextureFlag is specified the GrRenderTarget is
* accessible via GrTexture::asRenderTarget(). The texture will hold a ref
* on the render target until its releaseRenderTarget() is called or it is
* destroyed.
*
* @param desc describes the texture to be created.
* @param srcData texel data to load texture. Begins with full-size
* palette data for paletted textures. Contains width*
* height texels. If NULL texture data is uninitialized.
*
* @return The texture object if successful, otherwise NULL.
*/
GrTexture* createTexture(const GrTextureDesc& desc,
const void* srcData, size_t rowBytes);
GrResource* createPlatformSurface(const GrPlatformSurfaceDesc& desc);
/**
* Reads the current target object (e.g. FBO or IDirect3DSurface9*) and
* viewport state from the underlying 3D API and wraps it in a
* GrRenderTarget. The GrRenderTarget will not attempt to delete/destroy the
* underlying object in its destructor and it is up to caller to guarantee
* that it remains valid while the GrRenderTarget is used.
*
* @return the newly created GrRenderTarget
*/
GrRenderTarget* createRenderTargetFrom3DApiState();
/**
* Creates a vertex buffer.
*
* @param size size in bytes of the vertex buffer
* @param dynamic hints whether the data will be frequently changed
* by either GrVertexBuffer::lock or
* GrVertexBuffer::updateData.
*
* @return The vertex buffer if successful, otherwise NULL.
*/
GrVertexBuffer* createVertexBuffer(uint32_t size, bool dynamic);
/**
* Creates an index buffer.
*
* @param size size in bytes of the index buffer
* @param dynamic hints whether the data will be frequently changed
* by either GrIndexBuffer::lock or
* GrIndexBuffer::updateData.
*
* @return The index buffer if successful, otherwise NULL.
*/
GrIndexBuffer* createIndexBuffer(uint32_t size, bool dynamic);
/**
* Are 8 bit paletted textures supported.
*
* @return true if 8bit palette textures are supported, false otherwise
*/
bool supports8BitPalette() const { return f8bitPaletteSupport; }
/**
* returns true if two sided stenciling is supported. If false then only
* the front face values of the GrStencilSettings
* @return true if only a single stencil pass is needed.
*/
bool supportsTwoSidedStencil() const
{ return fTwoSidedStencilSupport; }
/**
* returns true if stencil wrap is supported. If false then
* kIncWrap_StencilOp and kDecWrap_StencilOp are treated as
* kIncClamp_StencilOp and kDecClamp_StencilOp, respectively.
* @return true if stencil wrap ops are supported.
*/
bool supportsStencilWrapOps() const
{ return fStencilWrapOpsSupport; }
/**
* Checks whether locking vertex and index buffers is supported.
*
* @return true if locking is supported.
*/
bool supportsBufferLocking() const { return fBufferLockSupport; }
/**
* Does the 3D API support anti-aliased lines. If so then line primitive
* types will use this functionality when the AA state flag is set.
*/
bool supportsAALines() const { return fAALineSupport; }
/**
* Does the subclass support GrSamplerState::k4x4Downsample_Filter
*/
bool supports4x4DownsampleFilter() const { return f4X4DownsampleFilterSupport; }
/**
* Does this instance support dual-source blending? Required for proper
* blending with partial coverage with certain blend modes (dst coeff is
* not 1, ISA, or ISC)
*/
bool supportsDualSourceBlending() const {
return fDualSourceBlendingSupport;
}
/**
* Gets the minimum width of a render target. If a texture/rt is created
* with a width less than this size the GrGpu object will clamp it to this
* value.
*/
int minRenderTargetWidth() const { return fMinRenderTargetWidth; }
/**
* Gets the minimum width of a render target. If a texture/rt is created
* with a height less than this size the GrGpu object will clamp it to this
* value.
*/
int minRenderTargetHeight() const { return fMinRenderTargetHeight; }
/**
* Reports whether full scene anti-aliasing is supported.
*/
bool supportsFullsceneAA() const { return fFSAASupport; }
/**
* Returns true if NPOT textures can be created
*
* @return true if NPOT textures can be created
*/
bool npotTextureSupport() const { return fNPOTTextureSupport; }
/**
* Returns true if NPOT textures can be repeat/mirror tiled.
*
* @return true if NPOT textures can be tiled
*/
bool npotTextureTileSupport() const { return fNPOTTextureTileSupport; }
/**
* Returns true if a NPOT texture can be a rendertarget
*
* @return the true if NPOT texture/rendertarget can be created.
*/
bool npotRenderTargetSupport() const { return fNPOTRenderTargetSupport; }
/**
* Gets the largest allowed width and height of a texture.
*/
int maxTextureSize() const { return fMaxTextureSize; }
/**
* Gets the largest allowed width and height of a render target.
*/
int maxRenderTargetSize() const { return fMaxRenderTargetSize; }
int maxRenderTargetCount() const { return fMaxRenderTargetCnt; }
int renderTargetCount() const { return fRenderTargetCnt; }
virtual void clear(const GrIRect* rect, GrColor color);
/**
* Installs a path renderer that will be used to draw paths that are
* part of the clip.
*/
void setClipPathRenderer(GrPathRenderer* pathRenderer) {
GrSafeAssign(fClientPathRenderer, pathRenderer);
}
/**
* Returns an index buffer that can be used to render quads.
* Six indices per quad: 0, 1, 2, 0, 2, 3, etc.
* The max number of quads can be queried using GrIndexBuffer::maxQuads().
* Draw with kTriangles_PrimitiveType
* @ return the quad index buffer
*/
const GrIndexBuffer* getQuadIndexBuffer() const;
/**
* Returns a vertex buffer with four position-only vertices [(0,0), (1,0),
* (1,1), (0,1)].
* @ return unit square vertex buffer
*/
const GrVertexBuffer* getUnitSquareVertexBuffer() const;
/**
* Ensures that the current render target is actually set in the
* underlying 3D API. Used when client wants to use 3D API to directly
* render to the RT.
*/
void forceRenderTargetFlush();
/**
* Reads a rectangle of pixels from a render target.
* @param renderTarget the render target to read from. NULL means the
* current render target.
* @param left left edge of the rectangle to read (inclusive)
* @param top top edge of the rectangle to read (inclusive)
* @param width width of rectangle to read in pixels.
* @param height height of rectangle to read in pixels.
* @param config the pixel config of the destination buffer
* @param buffer memory to read the rectangle into.
*
* @return true if the read succeeded, false if not. The read can fail
* because of a unsupported pixel config or because no render
* target is currently set.
*/
bool readPixels(GrRenderTarget* renderTarget,
int left, int top, int width, int height,
GrPixelConfig config, void* buffer);
const GrGpuStats& getStats() const;
void resetStats();
void printStats() const;
/**
* Called to tell Gpu object that all GrResources have been lost and should
* be abandoned.
*/
virtual void abandonResources();
/**
* Called to tell Gpu object to release all GrResources.
*/
void releaseResources();
/**
* Add resource to list of resources. Should only be called by GrResource.
* @param resource the resource to add.
*/
void insertResource(GrResource* resource);
/**
* Remove resource from list of resources. Should only be called by
* GrResource.
* @param resource the resource to remove.
*/
void removeResource(GrResource* resource);
protected:
enum PrivateStateBits {
kFirstBit = (kLastPublicStateBit << 1),
kModifyStencilClip_StateBit = kFirstBit, // allows draws to modify
// stencil bits used for
// clipping.
};
/**
* Extensions to GrDrawTarget::StateBits to implement stencil clipping
*/
struct ClipState {
bool fClipInStencil;
bool fClipIsDirty;
} fClipState;
// GrDrawTarget override
virtual void clipWillBeSet(const GrClip& newClip);
// prepares clip flushes gpu state before a draw
bool setupClipAndFlushState(GrPrimitiveType type);
// Functions used to map clip-respecting stencil tests into normal
// stencil funcs supported by GPUs.
static GrStencilFunc ConvertStencilFunc(bool stencilInClip,
GrStencilFunc func);
static void ConvertStencilFuncAndMask(GrStencilFunc func,
bool clipInStencil,
unsigned int clipBit,
unsigned int userBits,
unsigned int* ref,
unsigned int* mask);
// stencil settings to clip drawing when stencil clipping is in effect
// and the client isn't using the stencil test.
static const GrStencilSettings gClipStencilSettings;
// defaults to false, subclass can set true to support palleted textures
bool f8bitPaletteSupport;
// set by subclass
bool fNPOTTextureSupport;
bool fNPOTTextureTileSupport;
bool fNPOTRenderTargetSupport;
bool fTwoSidedStencilSupport;
bool fStencilWrapOpsSupport;
bool fAALineSupport;
bool fFSAASupport;
bool f4X4DownsampleFilterSupport; // supports GrSamplerState::k4x4Downsample_Filter
bool fDualSourceBlendingSupport;
// set by subclass to true if index and vertex buffers can be locked, false
// otherwise.
bool fBufferLockSupport;
// set by subclass
int fMinRenderTargetWidth;
int fMinRenderTargetHeight;
int fMaxRenderTargetSize;
int fMaxTextureSize;
int fRenderTargetCnt;
int fMaxRenderTargetCnt;
GrGpuStats fStats;
struct GeometryPoolState {
const GrVertexBuffer* fPoolVertexBuffer;
int fPoolStartVertex;
const GrIndexBuffer* fPoolIndexBuffer;
int fPoolStartIndex;
};
const GeometryPoolState& getGeomPoolState() {
return fGeomPoolStateStack.back();
}
// GrDrawTarget overrides
virtual bool onReserveVertexSpace(GrVertexLayout vertexLayout,
int vertexCount,
void** vertices);
virtual bool onReserveIndexSpace(int indexCount, void** indices);
virtual void releaseReservedVertexSpace();
virtual void releaseReservedIndexSpace();
virtual void onSetVertexSourceToArray(const void* vertexArray,
int vertexCount);
virtual void onSetIndexSourceToArray(const void* indexArray,
int indexCount);
virtual void releaseVertexArray();
virtual void releaseIndexArray();
virtual void geometrySourceWillPush();
virtual void geometrySourceWillPop(const GeometrySrcState& restoredState);
// Helpers for setting up geometry state
void finalizeReservedVertices();
void finalizeReservedIndices();
// overridden by API-specific derived class to handle re-emitting 3D API
// preample and dirtying state cache.
virtual void resetContext() = 0;
// overridden by API-specific derived class to create objects.
virtual GrTexture* onCreateTexture(const GrTextureDesc& desc,
const void* srcData,
size_t rowBytes) = 0;
virtual GrResource* onCreatePlatformSurface(const GrPlatformSurfaceDesc& desc) = 0;
virtual GrRenderTarget* onCreateRenderTargetFrom3DApiState() = 0;
virtual GrVertexBuffer* onCreateVertexBuffer(uint32_t size,
bool dynamic) = 0;
virtual GrIndexBuffer* onCreateIndexBuffer(uint32_t size,
bool dynamic) = 0;
// overridden by API-specific derivated class to perform the clear and
// clearRect. NULL rect means clear whole target.
virtual void onClear(const GrIRect* rect, GrColor color) = 0;
// overridden by API-specific derived class to perform the draw call.
virtual void onGpuDrawIndexed(GrPrimitiveType type,
uint32_t startVertex,
uint32_t startIndex,
uint32_t vertexCount,
uint32_t indexCount) = 0;
virtual void onGpuDrawNonIndexed(GrPrimitiveType type,
uint32_t vertexCount,
uint32_t numVertices) = 0;
// overridden by API-specific derived class to perform flush
virtual void onForceRenderTargetFlush() = 0;
// overridden by API-specific derived class to perform the read pixels.
virtual bool onReadPixels(GrRenderTarget* target,
int left, int top, int width, int height,
GrPixelConfig, void* buffer) = 0;
// called to program the vertex data, indexCount will be 0 if drawing non-
// indexed geometry. The subclass may adjust the startVertex and/or
// startIndex since it may have already accounted for these in the setup.
virtual void setupGeometry(int* startVertex,
int* startIndex,
int vertexCount,
int indexCount) = 0;
// The GrGpu typically records the clients requested state and then flushes
// deltas from previous state at draw time. This function does the
// API-specific flush of the state
// returns false if current state is unsupported.
virtual bool flushGraphicsState(GrPrimitiveType type) = 0;
// Sets the scissor rect, or disables if rect is NULL.
virtual void flushScissor(const GrIRect* rect) = 0;
// GrGpu subclass removes the clip from the stencil buffer
virtual void clearStencilClip(const GrIRect& rect) = 0;
private:
GrContext* fContext; // not reffed (context refs gpu)
GrVertexBufferAllocPool* fVertexPool;
GrIndexBufferAllocPool* fIndexPool;
// counts number of uses of vertex/index pool in the geometry stack
int fVertexPoolUseCnt;
int fIndexPoolUseCnt;
enum {
kPreallocGeomPoolStateStackCnt = 4,
};
GrAlignedSTStorage<kPreallocGeomPoolStateStackCnt,
GeometryPoolState> fGeoSrcStateStackStorage;
GrTArray<GeometryPoolState, true> fGeomPoolStateStack;
mutable GrIndexBuffer* fQuadIndexBuffer; // mutable so it can be
// created on-demand
mutable GrVertexBuffer* fUnitSquareVertexBuffer; // mutable so it can be
// created on-demand
GrDefaultPathRenderer* fDefaultPathRenderer;
GrPathRenderer* fClientPathRenderer;
bool fContextIsDirty;
GrResource* fResourceHead;
// GrDrawTarget overrides
virtual void onDrawIndexed(GrPrimitiveType type,
int startVertex,
int startIndex,
int vertexCount,
int indexCount);
virtual void onDrawNonIndexed(GrPrimitiveType type,
int startVertex,
int vertexCount);
// readies the pools to provide vertex/index data.
void prepareVertexPool();
void prepareIndexPool();
// determines the path renderer used to draw a clip path element.
GrPathRenderer* getClipPathRenderer(const SkPath& path, GrPathFill fill);
void handleDirtyContext() {
if (fContextIsDirty) {
this->resetContext();
fContextIsDirty = false;
}
}
typedef GrDrawTarget INHERITED;
};
#endif

View File

@ -0,0 +1,208 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrGpuGL_DEFINED
#define GrGpuGL_DEFINED
#include "GrGpu.h"
#include "GrGLIRect.h"
#include "GrGLTexture.h"
#include "GrGLVertexBuffer.h"
#include "GrGLIndexBuffer.h"
class GrGpuGL : public GrGpu {
public:
virtual ~GrGpuGL();
protected:
GrGpuGL();
struct {
size_t fVertexOffset;
GrVertexLayout fVertexLayout;
const GrVertexBuffer* fVertexBuffer;
const GrIndexBuffer* fIndexBuffer;
bool fArrayPtrsDirty;
} fHWGeometryState;
struct AAState {
bool fMSAAEnabled;
bool fSmoothLineEnabled;
} fHWAAState;
DrState fHWDrawState;
bool fHWStencilClip;
// As flush of GL state proceeds it updates fHDrawState
// to reflect the new state. Later parts of the state flush
// may perform cascaded changes but cannot refer to fHWDrawState.
// These code paths can refer to the dirty flags. Subclass should
// call resetDirtyFlags after its flush is complete
struct {
bool fRenderTargetChanged : 1;
int fTextureChangedMask;
} fDirtyFlags;
GR_STATIC_ASSERT(8 * sizeof(int) >= kNumStages);
// clears the dirty flags
void resetDirtyFlags();
// last scissor / viewport scissor state seen by the GL.
struct {
bool fScissorEnabled;
GrGLIRect fScissorRect;
GrGLIRect fViewportRect;
} fHWBounds;
// GrGpu overrides
// overrides from GrGpu
virtual void resetContext();
virtual GrTexture* onCreateTexture(const GrTextureDesc& desc,
const void* srcData,
size_t rowBytes);
virtual GrVertexBuffer* onCreateVertexBuffer(uint32_t size,
bool dynamic);
virtual GrIndexBuffer* onCreateIndexBuffer(uint32_t size,
bool dynamic);
virtual GrResource* onCreatePlatformSurface(const GrPlatformSurfaceDesc& desc);
virtual GrRenderTarget* onCreateRenderTargetFrom3DApiState();
virtual void onClear(const GrIRect* rect, GrColor color);
virtual void onForceRenderTargetFlush();
virtual bool onReadPixels(GrRenderTarget* target,
int left, int top, int width, int height,
GrPixelConfig, void* buffer);
virtual void onGpuDrawIndexed(GrPrimitiveType type,
uint32_t startVertex,
uint32_t startIndex,
uint32_t vertexCount,
uint32_t indexCount);
virtual void onGpuDrawNonIndexed(GrPrimitiveType type,
uint32_t vertexCount,
uint32_t numVertices);
virtual void flushScissor(const GrIRect* rect);
void clearStencil(uint32_t value, uint32_t mask);
virtual void clearStencilClip(const GrIRect& rect);
virtual int getMaxEdges() const;
// binds texture unit in GL
void setTextureUnit(int unitIdx);
// binds appropriate vertex and index buffers, also returns any extra
// extra verts or indices to offset by.
void setBuffers(bool indexed,
int* extraVertexOffset,
int* extraIndexOffset);
// flushes state that is common to fixed and programmable GL
// dither
// line smoothing
// texture binding
// sampler state (filtering, tiling)
// FBO binding
// line width
bool flushGLStateCommon(GrPrimitiveType type);
// subclass should call this to flush the blend state
void flushBlend(GrPrimitiveType type,
GrBlendCoeff srcCoeff,
GrBlendCoeff dstCoeff);
// adjusts texture matrix to account for orientation, size, and npotness
static void AdjustTextureMatrix(const GrGLTexture* texture,
GrSamplerState::SampleMode mode,
GrMatrix* matrix);
// subclass may try to take advantage of identity tex matrices.
// This helper determines if matrix will be identity after all
// adjustments are applied.
static bool TextureMatrixIsIdentity(const GrGLTexture* texture,
const GrSamplerState& sampler);
static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff);
private:
// notify callbacks to update state tracking when related
// objects are bound to GL or deleted outside of the class
void notifyVertexBufferBind(const GrGLVertexBuffer* buffer);
void notifyVertexBufferDelete(const GrGLVertexBuffer* buffer);
void notifyIndexBufferBind(const GrGLIndexBuffer* buffer);
void notifyIndexBufferDelete(const GrGLIndexBuffer* buffer);
void notifyTextureDelete(GrGLTexture* texture);
void notifyRenderTargetDelete(GrRenderTarget* renderTarget);
void setSpareTextureUnit();
bool useSmoothLines();
// bound is region that may be modified and therefore has to be resolved.
// NULL means whole target. Can be an empty rect.
void flushRenderTarget(const GrIRect* bound);
void flushStencil();
void flushAAState(GrPrimitiveType type);
void resolveRenderTarget(GrGLRenderTarget* texture);
bool canBeTexture(GrPixelConfig config,
GrGLenum* internalFormat,
GrGLenum* format,
GrGLenum* type);
bool fboInternalFormat(GrPixelConfig config, GrGLenum* format);
friend class GrGLVertexBuffer;
friend class GrGLIndexBuffer;
friend class GrGLTexture;
friend class GrGLRenderTarget;
bool fHWBlendDisabled;
GrGLuint fAASamples[4];
enum {
kNone_MSFBO = 0, //<! no support for MSAA FBOs
kDesktopARB_MSFBO,//<! GL3.0-style MSAA FBO (GL_ARB_framebuffer_object)
kDesktopEXT_MSFBO,//<! earlier GL_EXT_framebuffer* extensions
kAppleES_MSFBO, //<! GL_APPLE_framebuffer_multisample ES extension
kIMG_MSFBO, //<! GL_IMG_multisampled_render_to_texture ES extension
} fMSFBOType;
// Do we have stencil wrap ops.
bool fHasStencilWrap;
// The maximum number of fragment uniform vectors (GLES has min. 16).
int fMaxFragmentUniformVectors;
// ES requires an extension to support RGBA8 in RenderBufferStorage
bool fRGBA8Renderbuffer;
int fActiveTextureUnitIdx;
// we record what stencil format worked last time to hopefully exit early
// from our loop that tries stencil formats and calls check fb status.
int fLastSuccessfulStencilFmtIdx;
typedef GrGpu INHERITED;
};
#endif

View File

@ -0,0 +1,72 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrGpuGLFixed_DEFINED
#define GrGpuGLFixed_DEFINED
#include "GrGpuGL.h"
// Fixed Pipeline OpenGL or OpenGL ES 1.x
class GrGpuGLFixed : public GrGpuGL {
public:
GrGpuGLFixed();
virtual ~GrGpuGLFixed();
protected:
// overrides from GrGpu
virtual bool flushGraphicsState(GrPrimitiveType type);
virtual void setupGeometry(int* startVertex,
int* startIndex,
int vertexCount,
int indexCount);
private:
virtual void resetContext();
// Helpers to make code more readable
const GrMatrix& getHWSamplerMatrix(int stage) const {
return fHWDrawState.fSamplerStates[stage].getMatrix();
}
void recordHWSamplerMatrix(int stage, const GrMatrix& matrix) {
fHWDrawState.fSamplerStates[stage].setMatrix(matrix);
}
// when the texture is GL_RGBA we set the GL_COMBINE texture
// environment rgb operand 0 to be GL_COLOR to modulate each incoming
// R,G, & B by the texture's R, G, & B. When the texture is alpha-only we
// set the operand to GL_ALPHA so that the incoming frag's R, G, &B are all
// modulated by the texture's A.
enum TextureEnvRGBOperands {
kAlpha_TextureEnvRGBOperand,
kColor_TextureEnvRGBOperand,
};
TextureEnvRGBOperands fHWRGBOperand0[kNumStages];
void flushProjectionMatrix();
// are the currently bound vertex buffers/arrays laid
// out for text or other drawing.
bool fTextVerts;
// On GL we have to build the base vertex offset into the
// glVertexPointer/glTexCoordPointer/etc
int fBaseVertex;
typedef GrGpuGL INHERITED;
};
#endif

View File

@ -0,0 +1,89 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrGpuGLShaders_DEFINED
#define GrGpuGLShaders_DEFINED
#include "GrGpuGL.h"
#include "GrGLProgram.h"
class GrGpuGLProgram;
// Programmable OpenGL or OpenGL ES 2.0
class GrGpuGLShaders : public GrGpuGL {
public:
GrGpuGLShaders();
virtual ~GrGpuGLShaders();
virtual void resetContext();
virtual void abandonResources();
protected:
// overrides from GrGpu
virtual bool flushGraphicsState(GrPrimitiveType type);
virtual void setupGeometry(int* startVertex,
int* startIndex,
int vertexCount,
int indexCount);
virtual void postDraw();
private:
class ProgramCache;
// Helpers to make code more readable
const GrMatrix& getHWSamplerMatrix(int stage);
void recordHWSamplerMatrix(int stage, const GrMatrix& matrix);
// sets the texture matrix uniform for currently bound program
void flushTextureMatrix(int stage);
// sets the texture domain uniform for currently bound program
void flushTextureDomain(int stage);
// sets the color specified by GrDrawTarget::setColor()
void flushColor();
// sets the MVP matrix uniform for currently bound program
void flushViewMatrix();
// flushes the parameters to two point radial gradient
void flushRadial2(int stage);
// flushes the normalized texel size
void flushTexelSize(int stage);
// flushes the edges for edge AA
void flushEdgeAAData();
static void DeleteProgram(GrGLProgram::CachedData* programData);
void ProgramUnitTest();
void buildProgram(GrPrimitiveType type);
ProgramCache* fProgramCache;
GrGLProgram::CachedData* fProgramData;
GrGLuint fHWProgramID;
GrGLProgram fCurrentProgram;
typedef GrGpuGL INHERITED;
};
#endif

View File

@ -0,0 +1,102 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrGpuGLShaders2_DEFINED
#define GrGpuGLShaders2_DEFINED
#include "GrGpuGL.h"
// Programmable OpenGL or OpenGL ES 2.0
class GrGpuGLShaders2 : public GrGpuGL {
public:
GrGpuGLShaders2();
virtual ~GrGpuGLShaders2();
virtual void resetContext();
protected:
// overrides from GrGpu
virtual bool flushGraphicsState(PrimitiveType type);
virtual void setupGeometry(uint32_t startVertex,
uint32_t startIndex,
uint32_t vertexCount,
uint32_t indexCount);
private:
void resetContextHelper();
// sets the texture matrix uniform for currently bound program
void flushTextureMatrix(int stage);
// sets the MVP matrix uniform for currently bound program
void flushViewMatrix();
// flushes the parameters to two point radial gradient
void flushRadial2(int stage);
// called at flush time to setup the appropriate program
void flushProgram(PrimitiveType type);
struct Program;
struct StageDesc;
struct ProgramDesc;
struct UniLocations;
struct StageUniLocations;
struct ShaderCodeSegments;
class ProgramCache;
// gets a description of needed shader
void getProgramDesc(PrimitiveType primType, ProgramDesc* desc);
// generates and compiles a program from a description and vertex layout
// will change GL's bound program
static void GenProgram(const ProgramDesc& desc, Program* program);
// generates code for a stage of the shader
static void GenStageCode(int stageNum,
const StageDesc& desc,
const char* psInColor,
const char* psOutColor,
const char* vsInCoord,
ShaderCodeSegments* segments,
StageUniLocations* locations);
// Compiles a GL shader, returns shader ID or 0 if failed
// params have same meaning as glShaderSource
static GLuint CompileShader(GLenum type, int stringCnt,
const char** strings,
int* stringLengths);
static void DeleteProgram(Program* program);
void ProgramUnitTest();
GrGLTexture::Orientation fTextureOrientation;
ProgramCache* fProgramCache;
Program* fProgram;
GLuint fHWProgramID;
typedef GrGpuGL INHERITED;
};
#endif

View File

@ -0,0 +1,104 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrGpuVertex_DEFINED
#define GrGpuVertex_DEFINED
#include "GrGLConfig.h"
#include "GrPoint.h"
#if GR_TEXT_SCALAR_IS_USHORT
typedef uint16_t GrTextScalar;
#define GrIntToTextScalar(x) ((uint16_t)x)
#define GrFixedToTextScalar(x) (x)
#elif GR_TEXT_SCALAR_IS_FIXED
typedef GrFixed GrTextScalar;
#define GrIntToTextScalar(x) GrIntToFixed(x)
#define GrFixedToTextScalar(x) (x)
#elif GR_TEXT_SCALAR_IS_FLOAT
typedef float GrTextScalar;
#define GrIntToTextScalar(x) ((GrTextScalar)x)
#define GrFixedToTextScalar(x) GrFixedToFloat(x)
#else
#error "Text scalar type not defined"
#endif
// text has its own vertex class, since it may want to be in fixed point (given)
// that it starts with all integers) even when the default vertices are floats
struct GrGpuTextVertex {
GrTextScalar fX;
GrTextScalar fY;
void set(GrTextScalar x, GrTextScalar y) {
fX = x;
fY = y;
}
void setI(int x, int y) {
fX = GrIntToTextScalar(x);
fY = GrIntToTextScalar(y);
}
void setX(GrFixed x, GrFixed y) {
fX = GrFixedToTextScalar(x);
fY = GrFixedToTextScalar(y);
}
// rect fan is counter-clockwise
void setRectFan(GrTextScalar l, GrTextScalar t, GrTextScalar r,
GrTextScalar b) {
GrGpuTextVertex* v = this;
v[0].set(l, t);
v[1].set(l, b);
v[2].set(r, b);
v[3].set(r, t);
}
void setIRectFan(int l, int t, int r, int b) {
this->setRectFan(GrIntToTextScalar(l), GrIntToTextScalar(t),
GrIntToTextScalar(r), GrIntToTextScalar(b));
}
void setIRectFan(int l, int t, int r, int b, size_t stride) {
GrAssert(stride > sizeof(GrGpuTextVertex));
char* v = (char*)this;
((GrGpuTextVertex*)(v + 0*stride))->setI(l, t);
((GrGpuTextVertex*)(v + 1*stride))->setI(l, b);
((GrGpuTextVertex*)(v + 2*stride))->setI(r, b);
((GrGpuTextVertex*)(v + 3*stride))->setI(r, t);
}
// counter-clockwise fan
void setXRectFan(GrFixed l, GrFixed t, GrFixed r, GrFixed b) {
this->setRectFan(GrFixedToTextScalar(l), GrFixedToTextScalar(t),
GrFixedToTextScalar(r), GrFixedToTextScalar(b));
}
void setXRectFan(GrFixed l, GrFixed t, GrFixed r, GrFixed b, size_t stride) {
GrAssert(stride > sizeof(GrGpuTextVertex));
char* v = (char*)this;
((GrGpuTextVertex*)(v + 0*stride))->setX(l, t);
((GrGpuTextVertex*)(v + 1*stride))->setX(l, b);
((GrGpuTextVertex*)(v + 2*stride))->setX(r, b);
((GrGpuTextVertex*)(v + 3*stride))->setX(r, t);
}
};
#endif

View File

@ -0,0 +1,35 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrIPoint_DEFINED
#define GrIPoint_DEFINED
#include "GrTypes.h"
struct GrIPoint {
public:
int32_t fX, fY;
GrIPoint(int32_t x, int32_t y) : fX(x), fY(y) {}
void set(int32_t x, int32_t y) {
fX = x;
fY = y;
}
};
#endif

View File

@ -0,0 +1,195 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrInOrderDrawBuffer_DEFINED
#define GrInOrderDrawBuffer_DEFINED
#include "GrDrawTarget.h"
#include "GrAllocPool.h"
#include "GrAllocator.h"
#include "GrClip.h"
class GrVertexBufferAllocPool;
class GrIndexBufferAllocPool;
/**
* GrInOrderDrawBuffer is an implementation of GrDrawTarget that queues up
* draws for eventual playback into a GrGpu. In theory one draw buffer could
* playback into another. When index or vertex buffers are used as geometry
* sources it is the callers the draw buffer only holds references to the
* buffers. It is the callers responsibility to ensure that the data is still
* valid when the draw buffer is played back into a GrGpu. Similarly, it is the
* caller's responsibility to ensure that all referenced textures, buffers,
* and rendertargets are associated in the GrGpu object that the buffer is
* played back into. The buffer requires VB and IB pools to store geometry.
*/
class GrInOrderDrawBuffer : public GrDrawTarget {
public:
/**
* Creates a GrInOrderDrawBuffer
*
* @param vertexPool pool where vertices for queued draws will be saved when
* the vertex source is either reserved or array.
* @param indexPool pool where indices for queued draws will be saved when
* the index source is either reserved or array.
*/
GrInOrderDrawBuffer(GrVertexBufferAllocPool* vertexPool,
GrIndexBufferAllocPool* indexPool);
virtual ~GrInOrderDrawBuffer();
/**
* Copies the draw state and clip from target to this draw buffer.
*
* @param target the target whose clip and state should be copied.
*/
void initializeDrawStateAndClip(const GrDrawTarget& target);
/**
* Provides the buffer with an index buffer that can be used for quad rendering.
* The buffer may be able to batch consecutive drawRects if this is provided.
* @param indexBuffer index buffer with quad indices.
*/
void setQuadIndexBuffer(const GrIndexBuffer* indexBuffer);
/**
* Empties the draw buffer of any queued up draws.
*/
void reset();
/**
* plays the queued up draws to another target. Does not empty this buffer so
* that it can be played back multiple times.
* @param target the target to receive the playback
*/
void playback(GrDrawTarget* target);
// overrides from GrDrawTarget
virtual void drawRect(const GrRect& rect,
const GrMatrix* matrix = NULL,
int stageEnableMask = 0,
const GrRect* srcRects[] = NULL,
const GrMatrix* srcMatrices[] = NULL);
virtual bool geometryHints(GrVertexLayout vertexLayout,
int* vertexCount,
int* indexCount) const;
virtual void clear(const GrIRect* rect, GrColor color);
private:
struct Draw {
GrPrimitiveType fPrimitiveType;
int fStartVertex;
int fStartIndex;
int fVertexCount;
int fIndexCount;
bool fStateChanged;
bool fClipChanged;
GrVertexLayout fVertexLayout;
const GrVertexBuffer* fVertexBuffer;
const GrIndexBuffer* fIndexBuffer;
};
struct Clear {
int fBeforeDrawIdx;
GrIRect fRect;
GrColor fColor;
};
// overrides from GrDrawTarget
virtual void onDrawIndexed(GrPrimitiveType primitiveType,
int startVertex,
int startIndex,
int vertexCount,
int indexCount);
virtual void onDrawNonIndexed(GrPrimitiveType primitiveType,
int startVertex,
int vertexCount);
virtual bool onReserveVertexSpace(GrVertexLayout layout,
int vertexCount,
void** vertices);
virtual bool onReserveIndexSpace(int indexCount, void** indices);
virtual void releaseReservedVertexSpace();
virtual void releaseReservedIndexSpace();
virtual void onSetVertexSourceToArray(const void* vertexArray,
int vertexCount);
virtual void onSetIndexSourceToArray(const void* indexArray,
int indexCount);
virtual void releaseVertexArray();
virtual void releaseIndexArray();
virtual void geometrySourceWillPush();
virtual void geometrySourceWillPop(const GeometrySrcState& restoredState);
virtual void clipWillBeSet(const GrClip& newClip);
bool needsNewState() const;
bool needsNewClip() const;
void pushState();
void pushClip();
GrTAllocator<Draw> fDraws;
GrTAllocator<SavedDrawState> fStates;
GrTAllocator<Clear> fClears;
GrTAllocator<GrClip> fClips;
bool fClipSet;
GrVertexLayout fLastRectVertexLayout;
const GrIndexBuffer* fQuadIndexBuffer;
int fMaxQuads;
int fCurrQuad;
GrVertexBufferAllocPool& fVertexPool;
GrIndexBufferAllocPool& fIndexPool;
struct GeometryPoolState {
const GrVertexBuffer* fPoolVertexBuffer;
int fPoolStartVertex;
const GrIndexBuffer* fPoolIndexBuffer;
int fPoolStartIndex;
// caller may conservatively over reserve vertices / indices.
// we release unused space back to allocator if possible
// can only do this if there isn't an intervening pushGeometrySource()
size_t fUsedPoolVertexBytes;
size_t fUsedPoolIndexBytes;
};
GrTArray<GeometryPoolState> fGeoPoolStateStack;
enum {
kDrawPreallocCnt = 8,
kStatePreallocCnt = 8,
kClipPreallocCnt = 8,
kClearPreallocCnt = 4,
kGeoPoolStatePreAllocCnt = 4,
};
GrAlignedSTStorage<kDrawPreallocCnt, Draw> fDrawStorage;
GrAlignedSTStorage<kStatePreallocCnt, SavedDrawState> fStateStorage;
GrAlignedSTStorage<kClipPreallocCnt, GrClip> fClipStorage;
GrAlignedSTStorage<kClearPreallocCnt, Clear> fClearStorage;
GrAlignedSTStorage<kGeoPoolStatePreAllocCnt,
GeometryPoolState> fGeoStackStorage;
typedef GrDrawTarget INHERITED;
};
#endif

View File

@ -0,0 +1,38 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrIndexBuffer_DEFINED
#define GrIndexBuffer_DEFINED
#include "GrGeometryBuffer.h"
class GrIndexBuffer : public GrGeometryBuffer {
public:
/**
* Retrieves the maximum number of quads that could be rendered
* from the index buffer (using kTriangles_PrimitiveType).
* @return the maximum number of quads using full size of index buffer.
*/
int maxQuads() const { return size() / (sizeof(uint16_t) * 6); }
protected:
GrIndexBuffer(GrGpu* gpu, size_t sizeInBytes, bool dynamic)
: INHERITED(gpu, sizeInBytes, dynamic) {}
private:
typedef GrGeometryBuffer INHERITED;
};
#endif

View File

@ -0,0 +1,47 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrInstanceCounter_DEFINED
#define GrInstanceCounter_DEFINED
#include "GrTypes.h"
template <typename T> class GrInstanceCounter {
public:
GrInstanceCounter() {
++gCounter;
GrPrintf("+ %s %d\n", T::InstanceCounterClassName(), gCounter);
}
~GrInstanceCounter() {
--gCounter;
GrPrintf("- %s %d\n", T::InstanceCounterClassName(), gCounter);
}
private:
static int gCounter;
};
template <typename T> int GrInstanceCounter<T>::gCounter;
#define DECLARE_INSTANCE_COUNTER(T) \
static const char* InstanceCounterClassName() { return #T; } \
friend class GrInstanceCounter<T>; \
GrInstanceCounter<T> fInstanceCounter
#endif

View File

@ -0,0 +1,47 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrKey_DEFINED
#define GrKey_DEFINED
#include "GrRefCnt.h"
class GrKey : public GrRefCnt {
public:
typedef intptr_t Hash;
explicit GrKey(Hash hash) : fHash(hash) {}
intptr_t getHash() const { return fHash; }
bool operator<(const GrKey& rh) const {
return fHash < rh.fHash || (fHash == rh.fHash && this->lt(rh));
}
bool operator==(const GrKey& rh) const {
return fHash == rh.fHash && this->eq(rh);
}
protected:
virtual bool lt(const GrKey& rh) const = 0;
virtual bool eq(const GrKey& rh) const = 0;
private:
const Hash fHash;
};
#endif

View File

@ -0,0 +1,26 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrMatrix_DEFINED
#define GrMatrix_DEFINED
#include "GrRect.h"
#include "SkMatrix.h"
typedef SkMatrix GrMatrix;
#endif

View File

@ -0,0 +1,181 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrMemory_DEFINED
#define GrMemory_DEFINED
#include "GrNoncopyable.h"
class GrAutoMalloc : GrNoncopyable {
public:
GrAutoMalloc() : fPtr(NULL), fAllocatedBytes(0){
}
GrAutoMalloc(size_t bytes) : fPtr(GrMalloc(bytes)), fAllocatedBytes(bytes) {}
~GrAutoMalloc() { GrFree(fPtr); }
/**
* Return the allocated memory, or NULL if it has already been freed or
* detached.
*/
void* get() const { return fPtr; }
size_t size() const { return fAllocatedBytes; }
/**
* transfer ownership of the memory to the caller. It must be freed with
* a call to GrFree()
*/
void* detach() {
void* ptr = fPtr;
fPtr = NULL; // we no longer own the block
fAllocatedBytes = 0;
return ptr;
}
/**
* Reallocates to a new size. May or may not call malloc. The contents
* are not preserved. If growOnly is true it will never reduce the
* allocated size.
*/
void* realloc(size_t newSize, bool growOnly = false) {
bool alloc;
if (growOnly) {
alloc = newSize > fAllocatedBytes;
} else {
alloc = newSize != fAllocatedBytes;
}
if (alloc) {
GrFree(fPtr);
fPtr = newSize ? GrMalloc(newSize) : NULL;
fAllocatedBytes = newSize;
}
GrAssert(fAllocatedBytes >= newSize);
GR_DEBUGCODE(memset(fPtr, 0xEF, fAllocatedBytes));
return fPtr;
}
/**
* free the block now. get() will now return NULL
*/
void free() {
GrFree(fPtr);
fPtr = NULL;
fAllocatedBytes = 0;
}
private:
void* fPtr;
size_t fAllocatedBytes;
};
/**
* Variant of GrAutoMalloc with a compile-time specified byte size that is
* pre-allocated in the class object, avoiding a call to to GrMalloc if
* possible.
*/
template <size_t SIZE> class GrAutoSMalloc : GrNoncopyable {
public:
GrAutoSMalloc() {
fPtr = fStorage;
fAllocatedBytes = SIZE;
}
explicit GrAutoSMalloc(size_t bytes) {
if (bytes > SIZE) {
fPtr = GrMalloc(bytes);
fAllocatedBytes = bytes;
} else {
fPtr = fStorage;
fAllocatedBytes = SIZE;
}
}
~GrAutoSMalloc() {
if (fPtr != (void*)fStorage) {
GrFree(fPtr);
}
}
/**
* Return the allocated memory, or NULL if it has already been freed or
* detached.
*/
void* get() const { return fPtr; }
/**
* Reallocates to a new size. May or may not call malloc. The contents
* are not preserved. If growOnly is true it will never reduce the
* allocated size.
*/
void* realloc(size_t newSize, bool growOnly = false) {
if (newSize <= SIZE) {
if (NULL == fPtr) {
fPtr = fStorage;
fAllocatedBytes = SIZE;
} else if (!growOnly && fPtr != (void*)fStorage) {
GrFree(fPtr);
fPtr = fStorage;
fAllocatedBytes = SIZE;
}
} else if ((newSize > fAllocatedBytes) ||
(!growOnly && newSize < (fAllocatedBytes >> 1))) {
if (NULL != fPtr && fPtr != (void*)fStorage) {
GrFree(fPtr);
}
fPtr = GrMalloc(newSize);
fAllocatedBytes = newSize;
}
GrAssert(fAllocatedBytes >= newSize);
GrAssert((fPtr == fStorage) == (fAllocatedBytes == SIZE));
GR_DEBUGCODE(memset(fPtr, 0xEF, fAllocatedBytes));
return fPtr;
}
/**
* free the block now. get() will now return NULL
*/
void free() {
if (fPtr != (void*)fStorage) {
GrFree(fPtr);
}
fAllocatedBytes = 0;
fPtr = NULL;
}
private:
void* fPtr;
uint32_t fAllocatedBytes;
uint32_t fStorage[GrALIGN4(SIZE) >> 2];
};
/**
* Variant of GrAutoMalloc with a compile-time specified byte size that is
* pre-allocated in the class object, avoiding a call to to GrMalloc if
* possible.
*/
template <int COUNT, typename T>
class GrAutoSTMalloc : public GrAutoSMalloc<COUNT * sizeof(T)> {
public:
GrAutoSTMalloc(int count) : GrAutoSMalloc<COUNT * sizeof(T)>(count * sizeof(T)) {}
operator T*() { return (T*)this->get(); }
};
#endif

View File

@ -0,0 +1,42 @@
#ifndef GrMesh_DEFINED
#define GrMesh_DEFINED
#include "SkRect.h"
#include "SkPoint.h"
class SkCanvas;
class SkPaint;
class GrMesh {
public:
GrMesh();
~GrMesh();
GrMesh& operator=(const GrMesh& src);
void init(const SkRect& bounds, int rows, int cols,
const SkRect& texture);
const SkRect& bounds() const { return fBounds; }
int rows() const { return fRows; }
int cols() const { return fCols; }
SkPoint& pt(int row, int col) {
return fPts[row * (fRows + 1) + col];
}
void draw(SkCanvas*, const SkPaint&);
void drawWireframe(SkCanvas* canvas, const SkPaint& paint);
private:
SkRect fBounds;
int fRows, fCols;
SkPoint* fPts;
SkPoint* fTex; // just points into fPts, not separately allocated
int fCount;
uint16_t* fIndices;
int fIndexCount;
};
#endif

View File

@ -0,0 +1,38 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrNoncopyable_DEFINED
#define GrNoncopyable_DEFINED
#include "GrTypes.h"
/**
* Base for classes that want to disallow copying themselves. It makes its
* copy-constructor and assignment operators private (and unimplemented).
*/
class GR_API GrNoncopyable {
public:
GrNoncopyable() {}
private:
// illegal
GrNoncopyable(const GrNoncopyable&);
GrNoncopyable& operator=(const GrNoncopyable&);
};
#endif

View File

@ -0,0 +1,253 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrPaint_DEFINED
#define GrPaint_DEFINED
#include "GrTexture.h"
#include "GrColor.h"
#include "GrSamplerState.h"
#include "SkXfermode.h"
/**
* The paint describes how pixels are colored when the context draws to
* them. TODO: Make this a "real" class with getters and setters, default
* values, and documentation.
*/
class GrPaint {
public:
enum {
kMaxTextures = 1,
kMaxMasks = 1,
};
// All the paint fields are public except textures/samplers
GrBlendCoeff fSrcBlendCoeff;
GrBlendCoeff fDstBlendCoeff;
bool fAntiAlias;
bool fDither;
bool fFallback;
GrColor fColor;
GrColor fColorFilterColor;
SkXfermode::Mode fColorFilterXfermode;
void setTexture(int i, GrTexture* texture) {
GrAssert((unsigned)i < kMaxTextures);
GrSafeRef(texture);
GrSafeUnref(fTextures[i]);
fTextures[i] = texture;
}
GrTexture* getTexture(int i) const {
GrAssert((unsigned)i < kMaxTextures);
return fTextures[i];
}
GrSamplerState* getTextureSampler(int i) {
GrAssert((unsigned)i < kMaxTextures);
return fTextureSamplers + i;
}
const GrSamplerState* getTextureSampler(int i) const {
GrAssert((unsigned)i < kMaxTextures);
return fTextureSamplers + i;
}
// The mask can be alpha-only or per channel. It is applied
// after the colorfilter
void setMask(int i, GrTexture* mask) {
GrAssert((unsigned)i < kMaxMasks);
GrSafeRef(mask);
GrSafeUnref(fMaskTextures[i]);
fMaskTextures[i] = mask;
}
GrTexture* getMask(int i) const {
GrAssert((unsigned)i < kMaxMasks);
return fMaskTextures[i];
}
// mask's sampler matrix is always applied to the positions
// (i.e. no explicit texture coordinates)
GrSamplerState* getMaskSampler(int i) {
GrAssert((unsigned)i < kMaxMasks);
return fMaskSamplers + i;
}
const GrSamplerState* getMaskSampler(int i) const {
GrAssert((unsigned)i < kMaxMasks);
return fMaskSamplers + i;
}
// pre-concats sampler matrices for non-NULL textures and masks
void preConcatActiveSamplerMatrices(const GrMatrix& matrix) {
for (int i = 0; i < kMaxTextures; ++i) {
fTextureSamplers[i].preConcatMatrix(matrix);
}
for (int i = 0; i < kMaxMasks; ++i) {
fMaskSamplers[i].preConcatMatrix(matrix);
}
}
// uninitialized
GrPaint() {
for (int i = 0; i < kMaxTextures; ++i) {
fTextures[i] = NULL;
}
for (int i = 0; i < kMaxMasks; ++i) {
fMaskTextures[i] = NULL;
}
fFallback = false;
}
GrPaint(const GrPaint& paint) {
fSrcBlendCoeff = paint.fSrcBlendCoeff;
fDstBlendCoeff = paint.fDstBlendCoeff;
fAntiAlias = paint.fAntiAlias;
fDither = paint.fDither;
fColor = paint.fColor;
fColorFilterColor = paint.fColorFilterColor;
fColorFilterXfermode = paint.fColorFilterXfermode;
for (int i = 0; i < kMaxTextures; ++i) {
fTextureSamplers[i] = paint.fTextureSamplers[i];
fTextures[i] = paint.fTextures[i];
GrSafeRef(fTextures[i]);
}
for (int i = 0; i < kMaxMasks; ++i) {
fMaskSamplers[i] = paint.fMaskSamplers[i];
fMaskTextures[i] = paint.fMaskTextures[i];
GrSafeRef(fMaskTextures[i]);
}
fFallback = false;
}
~GrPaint() {
for (int i = 0; i < kMaxTextures; ++i) {
GrSafeUnref(fTextures[i]);
}
for (int i = 0; i < kMaxMasks; ++i) {
GrSafeUnref(fMaskTextures[i]);
}
}
// sets paint to src-over, solid white, no texture, no mask
void reset() {
this->resetBlend();
this->resetOptions();
this->resetColor();
this->resetTextures();
this->resetColorFilter();
this->resetMasks();
}
void resetColorFilter() {
fColorFilterXfermode = SkXfermode::kDst_Mode;
fColorFilterColor = GrColorPackRGBA(0xff, 0xff, 0xff, 0xff);
}
bool hasTexture() const {
return 0 != this->getActiveTextureStageMask();
}
bool hasMask() const {
return 0 != this->getActiveMaskStageMask();
}
bool hasTextureOrMask() const {
return this->hasTexture() || this->hasMask();
}
// helpers for GrContext, GrTextContext
int getActiveTextureStageMask() const {
int mask = 0;
for (int i = 0; i < kMaxTextures; ++i) {
if (NULL != fTextures[i]) {
mask |= 1 << (i + kFirstTextureStage);
}
}
return mask;
}
int getActiveMaskStageMask() const {
int mask = 0;
for (int i = 0; i < kMaxMasks; ++i) {
if (NULL != fMaskTextures[i]) {
mask |= 1 << (i + kFirstMaskStage);
}
}
return mask;
}
int getActiveStageMask() const {
return this->getActiveTextureStageMask() |
this->getActiveMaskStageMask();
}
// internal use
// GrPaint's textures and masks map to the first N stages
// of GrDrawTarget in that order (textures followed by masks)
enum {
kFirstTextureStage = 0,
kFirstMaskStage = kMaxTextures,
kTotalStages = kMaxTextures + kMaxMasks,
};
private:
GrSamplerState fTextureSamplers[kMaxTextures];
GrSamplerState fMaskSamplers[kMaxMasks];
GrTexture* fTextures[kMaxTextures];
GrTexture* fMaskTextures[kMaxMasks];
void resetBlend() {
fSrcBlendCoeff = kOne_BlendCoeff;
fDstBlendCoeff = kZero_BlendCoeff;
}
void resetOptions() {
fAntiAlias = false;
fDither = false;
}
void resetColor() {
fColor = GrColorPackRGBA(0xff, 0xff, 0xff, 0xff);
}
void resetTextures() {
for (int i = 0; i < kMaxTextures; ++i) {
this->setTexture(i, NULL);
fTextureSamplers[i].setClampNoFilter();
}
}
void resetMasks() {
for (int i = 0; i < kMaxMasks; ++i) {
this->setMask(i, NULL);
fMaskSamplers[i].setClampNoFilter();
}
}
};
#endif

View File

@ -0,0 +1,27 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrPath_DEFINED
#define GrPath_DEFINED
#include "GrTypes.h"
#include "SkPath.h"
typedef SkPath GrPath;
#endif

View File

@ -0,0 +1,110 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrPathIter_DEFINED
#define GrPathIter_DEFINED
#include "GrTypes.h"
struct GrPoint;
/**
2D Path iterator. Porting layer creates a subclass of this. It allows Ganesh to
parse the top-level API's 2D paths. Supports lines, quadratics, and cubic
pieces and moves (multi-part paths).
*/
class GrPathIter {
public:
/**
Returned by next(). Indicates the next piece of the path.
*/
enum Command {
kMove_Command, //!< next() returns 1 pt
// Starts a new subpath at
// at the returned point
kLine_Command, //!< next() returns 2 pts
// Adds a line segment
kQuadratic_Command, //!< next() returns 3 pts
// Adds a quadratic segment
kCubic_Command, //!< next() returns 4 pts
// Adds a cubic segment
kClose_Command, //!< next() returns 0 pts
kEnd_Command //!< next() returns 0 pts
// Implictly closes the last
// point
};
enum ConvexHint {
kNone_ConvexHint, //<! No hint about convexity
// of the path
kConvex_ConvexHint, //<! Path is one convex piece
kNonOverlappingConvexPieces_ConvexHint, //<! Multiple convex pieces,
// pieces are known to be
// disjoint
kSameWindingConvexPieces_ConvexHint, //<! Multiple convex pieces,
// may or may not intersect,
// either all wind cw or all
// wind ccw.
kConcave_ConvexHint //<! Path is known to be
// concave
};
static int NumCommandPoints(Command cmd) {
static const int numPoints[] = {
1, 2, 3, 4, 0, 0
};
return numPoints[cmd];
}
virtual ~GrPathIter() {};
/**
Iterates through the path. Should not be called after
kEnd_Command has been returned once. This version retrieves the
points for the command.
@param points The points relevant to returned commend. See Command
enum for number of points valid for each command.
@return The next command of the path.
*/
virtual Command next(GrPoint points[4]) = 0;
/**
* If the host API has knowledge of the convexity of the path
* it can be communicated by this hint. Ganesh can make these
* determinations itself. So it is not necessary to compute
* convexity status if it isn't already determined.
*
* @return a hint about the convexity of the path.
*/
virtual ConvexHint hint() const { return kNone_ConvexHint; }
/**
Iterates through the path. Should not be called after
kEnd_Command has been returned once. This version does not retrieve the
points for the command.
@return The next command of the path.
*/
virtual Command next() = 0;
/**
Restarts iteration from the beginning.
*/
virtual void rewind() = 0;
};
#endif

View File

@ -0,0 +1,185 @@
/*
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrPathRenderer_DEFINED
#define GrPathRenderer_DEFINED
#include "GrDrawTarget.h"
class SkPath;
struct GrPoint;
/**
* Base class for drawing paths into a GrDrawTarget.
*/
class GR_API GrPathRenderer : public GrRefCnt {
public:
GrPathRenderer(void);
/**
* Returns true if this path renderer is able to render the path.
* Returning false allows the caller to fallback to another path renderer.
*
* @param target The target to draw into
* @param path The path to draw
* @param fill The fill rule to use
*
* @return true if the path can be drawn by this object, false otherwise.
*/
virtual bool canDrawPath(const GrDrawTarget* target, const SkPath& path,
GrPathFill fill) const = 0;
/**
* Draws a path into the draw target. The target will already have its draw
* state configured for the draw.
* @param target the target to draw into.
* @param stages indicates which stages the are already
* in use. All enabled stages expect positions
* as texture coordinates. The path renderer
* use the remaining stages for its path
* filling algorithm.
* @param path the path to draw.
* @param fill the fill rule to apply.
* @param translate optional additional translation to apply to
* the path. NULL means (0,0).
*/
virtual void drawPath(GrDrawTarget* target,
GrDrawTarget::StageBitfield stages,
const SkPath& path,
GrPathFill fill,
const GrPoint* translate) = 0;
/**
* For complex clips Gr uses the stencil buffer. The path renderer must be
* able to render paths into the stencil buffer. However, the path renderer
* itself may require the stencil buffer to resolve the path fill rule. This
* function queries whether the path render needs its own stencil
* pass. If this returns false then drawPath() should not modify the
* the target's stencil settings but use those already set on target.
*
* @param target target that the path will be rendered to
* @param path the path that will be drawn
* @param fill the fill rule that will be used, will never be an inverse
* rule.
*
* @return false if this path renderer can generate interior-only fragments
* without changing the stencil settings on the target. If it
* returns true the drawPathToStencil will be used when rendering
* clips.
*/
virtual bool requiresStencilPass(const GrDrawTarget* target,
const SkPath& path,
GrPathFill fill) const { return false; }
/**
* Draws a path to the stencil buffer. Assume the writable stencil bits
* are already initialized to zero. Fill will always be either
* kWinding_PathFill or kEvenOdd_PathFill.
*
* Only called if requiresStencilPass returns true for the same combo of
* target, path, and fill. Never called with an inverse fill.
*
* The default implementation assumes the path filling algorithm doesn't
* require a separate stencil pass and so crashes.
*
*
* @param target the target to draw into.
* @param path the path to draw.
* @param fill the fill rule to apply.
* @param translate optional additional translation to apply to
* the path. NULL means (0,0).
*/
virtual void drawPathToStencil(GrDrawTarget* target,
const SkPath& path,
GrPathFill fill,
const GrPoint* translate) {
GrCrash("Unexpected call to drawPathToStencil.");
}
/**
* @return true if the path renderer can perform anti-aliasing (aside from
* having FSAA enabled for a render target)
*/
virtual bool supportsAA(GrDrawTarget* target,
const SkPath& path,
GrPathFill fill) { return false; }
/**
* This is called to install a custom path renderer in every GrContext at
* create time. The default implementation in GrCreatePathRenderer_none.cpp
* returns NULL. Link against another implementation to install your own.
*/
static GrPathRenderer* CreatePathRenderer();
/**
* Multiply curve tolerance by the given value, increasing or decreasing
* the maximum error permitted in tesselating curves with short straight
* line segments.
*/
void scaleCurveTolerance(GrScalar multiplier) {
GrAssert(multiplier > 0);
fCurveTolerance = SkScalarMul(fCurveTolerance, multiplier);
}
protected:
GrScalar fCurveTolerance;
private:
typedef GrRefCnt INHERITED;
};
/**
* Subclass that renders the path using the stencil buffer to resolve fill
* rules (e.g. winding, even-odd)
*/
class GR_API GrDefaultPathRenderer : public GrPathRenderer {
public:
GrDefaultPathRenderer(bool separateStencilSupport,
bool stencilWrapOpsSupport);
virtual bool canDrawPath(const GrDrawTarget* target,
const SkPath& path,
GrPathFill fill) const { return true; }
virtual void drawPath(GrDrawTarget* target,
GrDrawTarget::StageBitfield stages,
const SkPath& path,
GrPathFill fill,
const GrPoint* translate);
virtual bool requiresStencilPass(const GrDrawTarget* target,
const SkPath& path,
GrPathFill fill) const;
virtual void drawPathToStencil(GrDrawTarget* target,
const SkPath& path,
GrPathFill fill,
const GrPoint* translate);
private:
void onDrawPath(GrDrawTarget* target,
GrDrawTarget::StageBitfield stages,
const SkPath& path,
GrPathFill fill,
const GrPoint* translate,
bool stencilOnly);
bool fSeparateStencil;
bool fStencilWrapOps;
typedef GrPathRenderer INHERITED;
};
#endif

View File

@ -0,0 +1,36 @@
/*
Copyright 2010 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef GrPathSink_DEFINED
#define GrPathSink_DEFINED
#include "GrScalar.h"
class GrPathSink {
public:
virtual ~GrPathSink() {}
virtual void moveTo(GrScalar x, GrScalar y) = 0;
virtual void lineTo(GrScalar x, GrScalar y) = 0;
virtual void quadTo(GrScalar x0, GrScalar y0, GrScalar x1, GrScalar y1) = 0;
virtual void cubicTo(GrScalar x0, GrScalar y0, GrScalar x1, GrScalar y1,
GrScalar x2, GrScalar y2) = 0;
virtual void close() = 0;
};
#endif

Some files were not shown because too many files have changed in this diff Show More