[Libreoffice-commits] core.git: 8 commits - basic/source chart2/source sc/qa sc/source vcl/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Tue Jun 10 07:05:50 PDT 2014
basic/source/uno/namecont.cxx | 7 +
chart2/source/view/inc/GL3DRenderer.hxx | 2
chart2/source/view/main/GL3DRenderer.cxx | 19 +++--
sc/qa/unit/opencl-test.cxx | 5 +
sc/source/core/opencl/formulagroupcl.cxx | 114 ++++++++++++++++++++++++-------
sc/source/core/opencl/op_logical.cxx | 37 ++++++++++
sc/source/core/opencl/op_logical.hxx | 7 +
sc/source/core/opencl/op_math.cxx | 93 +++++++++----------------
sc/source/core/opencl/op_spreadsheet.cxx | 49 +++++++++++--
sc/source/core/opencl/op_spreadsheet.hxx | 1
sc/source/core/opencl/op_statistical.cxx | 92 ++++++++++++++-----------
sc/source/core/opencl/opbase.cxx | 10 +-
sc/source/core/opencl/opbase.hxx | 8 +-
vcl/source/opengl/OpenGLContext.cxx | 2
14 files changed, 305 insertions(+), 141 deletions(-)
New commits:
commit a903cac829f0c607b5895cbaae51ab4951ed8567
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Tue Jun 10 15:57:59 2014 +0200
fix assert
Change-Id: I55627efdf50bea4c1371b6c54df67cc71d5fce2f
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 951f4b5..ee6b2e3 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -3870,7 +3870,10 @@ void ScOpenclTest::testMathFormulaMod()
{
double fLibre = pDoc->GetValue(ScAddress(2,i,0));
double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
- CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ if(fExcel == 0.0f)
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, 1e-10);
+ else
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
xDocShRes->DoClose();
commit 7cfc80cb1663c1f4b4e813ab90c95fae01d1afc1
Author: haochen <haochen at multicorewarein.com>
Date: Sat May 31 14:28:22 2014 +0800
GPU Calc:Support default 2nd parameter in ROUND
Change-Id: I003ba9c945dbc3c6417d0502902610c0eaff2bda
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 9b45c91..5f6b4ff 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -1487,7 +1487,9 @@ public:
#ifdef UNROLLING_FACTOR
ss << "\tint i;\n\t";
- ss << "int currentCount0, currentCount1;\n\t";
+ ss << "int currentCount0;\n";
+ for ( unsigned i = 0; i < vSubArguments.size()-1; i++)
+ ss << "int currentCount"<<i+1<<";\n";
std::stringstream temp3,temp4;
int outLoopSize = UNROLLING_FACTOR;
if (nCurWindowSize/outLoopSize != 0){
diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx
index 36c94f6..555da592 100644
--- a/sc/source/core/opencl/op_math.cxx
+++ b/sc/source/core/opencl/op_math.cxx
@@ -1707,11 +1707,17 @@ void OpRound::GenSlidingWindowFunction(std::stringstream &ss,
ss << " int singleIndex = gid0;\n";
GenTmpVariables(ss,vSubArguments);
CheckAllSubArgumentIsNan(ss,vSubArguments);
- ss << " for(int i=0;i<tmp1;i++)\n";
- ss << " tmp0 = tmp0 * 10;\n";
+ if(vSubArguments.size() ==2)
+ {
+ ss << " for(int i=0;i<tmp1;i++)\n";
+ ss << " tmp0 = tmp0 * 10;\n";
+ }
ss << " double tmp=round(tmp0);\n";
- ss << " for(int i=0;i<tmp1;i++)\n";
- ss << " tmp = tmp / 10;\n";
+ if(vSubArguments.size() ==2)
+ {
+ ss << " for(int i=0;i<tmp1;i++)\n";
+ ss << " tmp = tmp / 10;\n";
+ }
ss << " return tmp;\n";
ss << "}";
}
commit c0ea62fcb7f2bd809eea0fd45fb71e31ffba871a
Author: haochen <haochen at multicorewareinc.com>
Date: Sat May 31 13:54:22 2014 +0800
GPU Calc:Support 3rd parameter in FLOOR
Change-Id: Ie3a265f34a5f589d41e802b63df4be6a64989b05
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 91a54f4..9b45c91 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -419,7 +419,7 @@ size_t DynamicKernelStringArgument::Marshal(cl_kernel k, int argno, int, cl_prog
if (CL_SUCCESS != err)
throw OpenCLError(err, __FILE__, __LINE__);
- cl_uint *pHashBuffer = (cl_uint*)clEnqueueMapBuffer(
+ pHashBuffer = (cl_uint*)clEnqueueMapBuffer(
kEnv.mpkCmdQueue, mpClmem, CL_TRUE, CL_MAP_WRITE, 0,
szHostBuffer, 0, NULL, NULL, &err);
if (CL_SUCCESS != err)
diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx
index 4a960b3..36c94f6 100644
--- a/sc/source/core/opencl/op_math.cxx
+++ b/sc/source/core/opencl/op_math.cxx
@@ -424,14 +424,6 @@ void OpEven::GenSlidingWindowFunction(std::stringstream &ss,
void OpMod::GenSlidingWindowFunction(std::stringstream &ss,
const std::string &sSymName, SubArguments &vSubArguments)
{
-#ifdef ISNAN
- FormulaToken *tmpCur0 = vSubArguments[0]->GetFormulaToken();
- const formula::SingleVectorRefToken*tmpCurDVR0= static_cast<const
- formula::SingleVectorRefToken *>(tmpCur0);
- FormulaToken *tmpCur1 = vSubArguments[0]->GetFormulaToken();
- const formula::SingleVectorRefToken*tmpCurDVR1= static_cast<const
- formula::SingleVectorRefToken *>(tmpCur1);
-#endif
ss << "\ndouble " << sSymName;
ss << "_"<< BinFuncName() <<"(";
for (unsigned i = 0; i < vSubArguments.size(); i++)
@@ -444,22 +436,13 @@ void OpMod::GenSlidingWindowFunction(std::stringstream &ss,
ss <<" int gid0=get_global_id(0);\n";
ss << " double arg0 = " << vSubArguments[0]->GenSlidingWindowDeclRef();
ss << ";\n";
- ss <<" double arg1 =" << vSubArguments[1]->GenSlidingWindowDeclRef();
+ ss << " double arg1 =" << vSubArguments[1]->GenSlidingWindowDeclRef();
ss << ";\n";
-#ifdef ISNAN
- ss<< " if(isNan(arg0)||(gid0>=";
- ss<<tmpCurDVR0->GetArrayLength();
- ss<<"))\n";
- ss<<" arg0 = 0;\n";
-#endif
-#ifdef ISNAN
- ss<< " if(isNan(arg1)||(gid0>=";
- ss<<tmpCurDVR1->GetArrayLength();
- ss<<"))\n";
- ss<<" arg1 = 0;\n";
-#endif
+ ss << " if(isNan(arg0)||arg0 == 0)\n";
+ ss << " return 0;\n";
+ ss << " if(isNan(arg1) || arg1 ==0)\n";
+ ss << " return NAN;\n";
ss << " double tem;\n";
- ss << " if(arg1 != 0) {\n";
ss << " if(arg0 < 0 && arg1 > 0)\n";
ss << " while(arg0 < 0)\n";
ss << " arg0 += arg1;\n";
@@ -467,9 +450,6 @@ void OpMod::GenSlidingWindowFunction(std::stringstream &ss,
ss << " while(arg0 > 0)\n";
ss << " arg0 += arg1;\n";
ss << " tem = fmod(arg0,arg1);\n";
- ss << " }\n";
- ss << " else\n";
- ss << " tem = 0;\n";
ss << " if(arg1 < 0 && tem > 0)\n";
ss << " tem = -tem;\n";
ss << " return tem;\n";
@@ -2318,9 +2298,6 @@ void OpFloor::GenSlidingWindowFunction(
std::stringstream &ss, const std::string &sSymName,
SubArguments &vSubArguments)
{
- FormulaToken *tmpCur = vSubArguments[0]->GetFormulaToken();
- const formula::SingleVectorRefToken*tmpCurDVR= static_cast<const
- formula::SingleVectorRefToken *>(tmpCur);
ss << "\ndouble " << sSymName;
ss << "_"<< BinFuncName() <<"(";
for (unsigned i = 0; i < vSubArguments.size(); i++)
@@ -2330,35 +2307,27 @@ void OpFloor::GenSlidingWindowFunction(
vSubArguments[i]->GenSlidingWindowDecl(ss);
}
ss << ")\n{\n";
- ss <<" int gid0=get_global_id(0);\n";
- ss << " double arg0 = " << vSubArguments[0]->GenSlidingWindowDeclRef();
- ss << ";\n";
- ss << " double arg1 = " << vSubArguments[1]->GenSlidingWindowDeclRef();
+ ss << " int gid0=get_global_id(0);\n";
+ ss << " double arg0,arg1,arg2=0.0;\n";
+ ss << " arg0 = " << vSubArguments[0]->GenSlidingWindowDeclRef();
ss << ";\n";
- ss << " double arg2 = " << vSubArguments[2]->GenSlidingWindowDeclRef();
+ ss << " arg1 = " << vSubArguments[1]->GenSlidingWindowDeclRef();
ss << ";\n";
-#ifdef ISNAN
- ss<< " if(isNan(arg0)||(gid0>=";
- ss<<tmpCurDVR->GetArrayLength();
- ss<<"))\n";
- ss<<" arg0 = 0;\n";
- ss<< " if(isNan(arg1)||(gid0>=";
- ss<<tmpCurDVR->GetArrayLength();
- ss<<"))\n";
- ss<<" arg1 = 0;\n";
- ss<< " if(isNan(arg2)||(gid0>=";
- ss<<tmpCurDVR->GetArrayLength();
- ss<<"))\n";
- ss<<" arg2 = 0;\n";
-#endif
- ss <<" if(arg1==0.0)\n";
- ss <<" return 0.0;\n";
- ss <<" else if(arg0*arg1<0.0)\n";
- ss <<" return 0.0000000001;\n";
- ss <<" else if(arg2==0.0&&arg0<0.0)\n";
- ss <<" return (trunc(arg0/arg1)+1)*arg1;\n";
- ss <<" else\n";
- ss <<" return trunc(arg0/arg1)*arg1;\n";
+ if ( 3 == vSubArguments.size() )
+ {
+ ss << " arg2 = " << vSubArguments[2]->GenSlidingWindowDeclRef();
+ ss << ";\n";
+ }
+ ss << " if(isNan(arg0) || isNan(arg1))\n";
+ ss << " return 0;\n";
+ ss << " if(isNan(arg2))\n";
+ ss << " arg2 = 0.0;\n";
+ ss << " if(arg0*arg1<0)\n";
+ ss << " return NAN;\n";
+ ss << " else if(arg2==0.0&&arg0<0.0)\n";
+ ss << " return (trunc(arg0/arg1)+1)*arg1;\n";
+ ss << " else\n";
+ ss << " return trunc(arg0/arg1)*arg1;\n";
ss << "}\n";
}
void OpBitOr::GenSlidingWindowFunction(std::stringstream &ss,
diff --git a/sc/source/core/opencl/op_statistical.cxx b/sc/source/core/opencl/op_statistical.cxx
index 88541e2..20dbb49 100644
--- a/sc/source/core/opencl/op_statistical.cxx
+++ b/sc/source/core/opencl/op_statistical.cxx
@@ -3678,6 +3678,20 @@ void OpGamma::GenSlidingWindowFunction(
void OpCorrel::GenSlidingWindowFunction(
std::stringstream &ss, const std::string &sSymName, SubArguments &vSubArguments)
{
+ if( vSubArguments.size() !=2 ||vSubArguments[0]->GetFormulaToken()
+ ->GetType() != formula::svDoubleVectorRef||vSubArguments[1]
+ ->GetFormulaToken()->GetType() != formula::svDoubleVectorRef )
+ ///only support DoubleVector in OpCorrelfor GPU calculating.
+ throw Unhandled();
+ const formula::DoubleVectorRefToken* pCurDVRX =
+ static_cast<const formula::DoubleVectorRefToken *>(
+ vSubArguments[0]->GetFormulaToken());
+ const formula::DoubleVectorRefToken* pCurDVRY =
+ static_cast<const formula::DoubleVectorRefToken *>(
+ vSubArguments[1]->GetFormulaToken());
+ if( pCurDVRX->GetRefRowSize() != pCurDVRY->GetRefRowSize() )
+ throw Unhandled();
+
ss << "\ndouble " << sSymName;
ss << "_"<< BinFuncName() <<"(";
for (unsigned i = 0; i < vSubArguments.size(); i++)
@@ -3698,16 +3712,8 @@ void OpCorrel::GenSlidingWindowFunction(
ss << "double arg1 = 0.0;\n\t";
ss << "int cnt = 0;\n\t";
- FormulaToken *pCurX = vSubArguments[0]->GetFormulaToken();
- FormulaToken *pCurY = vSubArguments[1]->GetFormulaToken();
- const formula::DoubleVectorRefToken* pCurDVRX =
- static_cast<const formula::DoubleVectorRefToken *>(pCurX);
- const formula::DoubleVectorRefToken* pCurDVRY =
- static_cast<const formula::DoubleVectorRefToken *>(pCurY);
- size_t nCurWindowSizeX = pCurDVRX->GetRefRowSize();
- size_t nCurWindowSizeY = pCurDVRY->GetRefRowSize();
- if(nCurWindowSizeX == nCurWindowSizeY)
- {
+ size_t nCurWindowSizeX = pCurDVRY->GetRefRowSize();
+
ss << "for (int i = ";
if (!pCurDVRX->IsStartFixed() && pCurDVRX->IsEndFixed()) {
ss << "gid0; i < " << nCurWindowSizeX << "; i++) {\n\t\t";
@@ -3880,7 +3886,6 @@ void OpCorrel::GenSlidingWindowFunction(
ss << "}\n\t";
ss << "}\n";
ss << "}";
- }
}
void OpNegbinomdist::GenSlidingWindowFunction(
@@ -3959,10 +3964,20 @@ void OpNegbinomdist::GenSlidingWindowFunction(
void OpPearson::GenSlidingWindowFunction(
std::stringstream &ss, const std::string &sSymName, SubArguments &vSubArguments)
{
- FormulaToken* pCur = vSubArguments[0]->GetFormulaToken();
- assert(pCur);
+ if( vSubArguments.size() !=2 ||vSubArguments[0]->GetFormulaToken()
+ ->GetType() != formula::svDoubleVectorRef||vSubArguments[1]
+ ->GetFormulaToken()->GetType() != formula::svDoubleVectorRef )
+ ///only support DoubleVector in OpPearson for GPU calculating.
+ throw Unhandled();
const formula::DoubleVectorRefToken* pDVR =
- static_cast<const formula::DoubleVectorRefToken *>(pCur);
+ static_cast<const formula::DoubleVectorRefToken *>(
+ vSubArguments[0]->GetFormulaToken());
+ const formula::DoubleVectorRefToken* pCurDVRY =
+ static_cast<const formula::DoubleVectorRefToken *>(
+ vSubArguments[1]->GetFormulaToken());
+ if( pDVR->GetRefRowSize() != pCurDVRY->GetRefRowSize() )
+ throw Unhandled();
+
size_t nCurWindowSize = pDVR->GetRefRowSize();
ss << "\ndouble " << sSymName;
@@ -4000,6 +4015,7 @@ void OpPearson::GenSlidingWindowFunction(
ss << ";\n";
ss << " fIny = "<<vSubArguments[1]->GenSlidingWindowDeclRef(true);
ss << " ;\n";
+ ss << " if(isNan(fInx)||isNan(fIny)){fInx=0.0;fIny=0.0;fCount = fCount-1;}\n";
ss << " fSumX += fInx;\n";
ss << " fSumY += fIny;\n";
ss << " fCount = fCount + 1;\n";
@@ -4026,6 +4042,7 @@ void OpPearson::GenSlidingWindowFunction(
ss << " ;\n";
ss << " fIny = "<<vSubArguments[1]->GenSlidingWindowDeclRef(true);
ss << " ;\n";
+ ss << " if(isNan(fInx)||isNan(fIny)){fInx=0.0;fIny=0.0;}\n";
ss << " fSumDeltaXDeltaY += (fInx - fMeanX) * (fIny - fMeanY);\n";
ss << " fSumX += pow(fInx - fMeanX,2);\n";
ss << " fSumY += pow(fIny - fMeanY,2);\n";
@@ -4579,11 +4596,21 @@ void OpCritBinom::GenSlidingWindowFunction(std::stringstream& ss,
void OpRsq::GenSlidingWindowFunction(
std::stringstream &ss, const std::string &sSymName, SubArguments &vSubArguments)
{
- FormulaToken* pCur = vSubArguments[1]->GetFormulaToken();
- assert(pCur);
- const formula::DoubleVectorRefToken* pCurDVR =
- static_cast<const formula::DoubleVectorRefToken *>(pCur);
- size_t nCurWindowSize = pCurDVR->GetRefRowSize();
+ if( vSubArguments.size() !=2 ||vSubArguments[0]->GetFormulaToken()
+ ->GetType() != formula::svDoubleVectorRef||vSubArguments[1]
+ ->GetFormulaToken()->GetType() != formula::svDoubleVectorRef )
+ ///only support DoubleVector in OpRsq for GPU calculating.
+ throw Unhandled();
+ const formula::DoubleVectorRefToken* pCurDVR1 =
+ static_cast<const formula::DoubleVectorRefToken *>(
+ vSubArguments[0]->GetFormulaToken());
+ const formula::DoubleVectorRefToken* pCurDVR2 =
+ static_cast<const formula::DoubleVectorRefToken *>(
+ vSubArguments[1]->GetFormulaToken());
+ if( pCurDVR1->GetRefRowSize() != pCurDVR2->GetRefRowSize() )
+ throw Unhandled();
+
+ size_t nCurWindowSize = pCurDVR1->GetRefRowSize();
ss << "\ndouble " << sSymName;
ss << "_"<< BinFuncName() <<"(";
@@ -4605,29 +4632,18 @@ void OpRsq::GenSlidingWindowFunction(
ss << " double tmp0,tmp1;\n";
vSubArguments.size();
ss <<"\n";
- FormulaToken *tmpCur0 = vSubArguments[0]->GetFormulaToken();
- const formula::DoubleVectorRefToken*tmpCurDVR0= static_cast<const
- formula::DoubleVectorRefToken *>(tmpCur0);
- FormulaToken *tmpCur1 = vSubArguments[1]->GetFormulaToken();
- const formula::DoubleVectorRefToken*tmpCurDVR1= static_cast<const
- formula::DoubleVectorRefToken *>(tmpCur1);
- ss << " int buffer_fInx_len = ";
- ss << tmpCurDVR0->GetArrayLength();
- ss << ";\n";
- ss << " int buffer_fIny_len = ";
- ss << tmpCurDVR1->GetArrayLength();
- ss << ";\n";
+
ss << " for(int i=0; i<"<<nCurWindowSize<<"; i++)\n";
ss << " {\n";
- ss << " if((gid0+i)>=buffer_fInx_len || isNan(";
- ss << vSubArguments[0]->GenSlidingWindowDeclRef();
+ ss << " if(isNan(";
+ ss << vSubArguments[0]->GenSlidingWindowDeclRef(true);
ss << "))\n";
ss << " fInx = 0;\n";
ss << " else\n";
ss << " fInx = "<<vSubArguments[0]->GenSlidingWindowDeclRef();
ss << ";\n";
- ss << " if((gid0+i)>=buffer_fIny_len || isNan(";
- ss << vSubArguments[1]->GenSlidingWindowDeclRef();
+ ss << " if(isNan(";
+ ss << vSubArguments[1]->GenSlidingWindowDeclRef(true);
ss << "))\n";
ss << " fIny = 0;\n";
ss << " else\n";
@@ -4643,14 +4659,14 @@ void OpRsq::GenSlidingWindowFunction(
ss << " fSumY = 0.0;\n";
ss << " for(int i=0; i<"<<nCurWindowSize<<"; i++)\n";
ss << " {\n";
- ss << " if((gid0+i)>=buffer_fInx_len || isNan(";
- ss << vSubArguments[0]->GenSlidingWindowDeclRef();
+ ss << " if(isNan(";
+ ss << vSubArguments[0]->GenSlidingWindowDeclRef(true);
ss << "))\n";
ss << " fInx = 0;\n";
ss << " else\n";
ss << " fInx = "<<vSubArguments[0]->GenSlidingWindowDeclRef();
ss << ";\n";
- ss << " if((gid0+i)>=buffer_fIny_len || isNan(";
+ ss << " if(isNan(";
ss << vSubArguments[1]->GenSlidingWindowDeclRef();
ss << "))\n";
ss << " fIny = 0;\n";
commit 0fa58160b90aa9817e5a6fb18c7427895f4b2f4f
Author: haochen <haochen at multicorewareinc.com>
Date: Thu May 29 09:14:53 2014 +0800
GPU Calc:Support IF formula in GPUInterpret
Change-Id: I9b2cebb99812d28e25c961129f73585d60690846
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index c0b62f2..91a54f4 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -1682,6 +1682,18 @@ public:
}
virtual std::string BinFuncName(void) const SAL_OVERRIDE { return "leq"; }
};
+class OpLess: public Binary {
+public:
+ virtual std::string GetBottom(void) SAL_OVERRIDE { return "0"; }
+ virtual std::string Gen2(const std::string &lhs, const std::string &rhs) const SAL_OVERRIDE
+ {
+ std::stringstream ss;
+ ss << "("<< lhs << "<" << rhs <<")";
+ return ss.str();
+ }
+ virtual std::string BinFuncName(void) const SAL_OVERRIDE { return "less"; }
+};
+
class OpGreater: public Binary {
public:
@@ -2267,6 +2279,9 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(
case ocLessEqual:
mvSubArguments.push_back(SoPHelper(ts, ft->Children[i], new OpLessEqual));
break;
+ case ocLess:
+ mvSubArguments.push_back(SoPHelper(ts, ft->Children[i], new OpLess));
+ break;
case ocEqual:
mvSubArguments.push_back(SoPHelper(ts, ft->Children[i], new OpEqual));
break;
@@ -2872,6 +2887,10 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(
mvSubArguments.push_back(SoPHelper(ts,
ft->Children[i], new OpAveDev));
break;
+ case ocIf:
+ mvSubArguments.push_back(SoPHelper(ts,
+ ft->Children[i], new OpIf));
+ break;
case ocExternal:
if ( !(pChild->GetExternal().compareTo(OUString(
"com.sun.star.sheet.addin.Analysis.getEffect"))))
diff --git a/sc/source/core/opencl/op_logical.cxx b/sc/source/core/opencl/op_logical.cxx
index 79dc74a..9dce77b 100644
--- a/sc/source/core/opencl/op_logical.cxx
+++ b/sc/source/core/opencl/op_logical.cxx
@@ -314,6 +314,43 @@ void OpXor::GenSlidingWindowFunction(std::stringstream &ss,
ss << " return t;\n";
ss << "}\n";
}
+void OpIf::GenSlidingWindowFunction(std::stringstream &ss,
+ const std::string &sSymName, SubArguments &vSubArguments)
+{
+ ss << "\ndouble " << sSymName;
+ ss << "_"<< BinFuncName() <<"(";
+ if(vSubArguments.size()!=3) throw Unhandled("unknown operand for ocPush");
+ for (unsigned i = 0; i < vSubArguments.size(); i++)
+ {
+ if (i)
+ ss << ",";
+ vSubArguments[i]->GenSlidingWindowDecl(ss);
+ }
+ ss << ") {\n";
+ ss << " int gid0 = get_global_id(0);\n";
+
+ FormulaToken *tmpCur0 = vSubArguments[0]->GetFormulaToken();
+ if(tmpCur0->GetType() == formula::svDoubleVectorRef)
+ {
+ throw UnhandledToken(tmpCur0, "unknown operand for ocPush");
+ }
+ else
+ {
+ ss << " if(isNan(";
+ ss << vSubArguments[0]->GenSlidingWindowDeclRef();
+ ss << ")|| ";
+ ss << vSubArguments[0]->GenSlidingWindowDeclRef();
+ ss << " == 0)\n";
+ ss << " return ";
+ ss << vSubArguments[2]->GenSlidingWindowDeclRef();
+ ss << ";\n";
+ ss << " else";
+ ss <<" return ";
+ ss << vSubArguments[1]->GenSlidingWindowDeclRef();
+ ss <<";\n";
+ }
+ ss << "}\n";
+}
}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/opencl/op_logical.hxx b/sc/source/core/opencl/op_logical.hxx
index 357ddd8..4365a57 100644
--- a/sc/source/core/opencl/op_logical.hxx
+++ b/sc/source/core/opencl/op_logical.hxx
@@ -44,6 +44,13 @@ public:
const std::string &sSymName, SubArguments &vSubArguments) SAL_OVERRIDE;
virtual std::string BinFuncName(void) const SAL_OVERRIDE { return "Xor"; }
};
+class OpIf:public Normal
+{
+public:
+ virtual void GenSlidingWindowFunction(std::stringstream &ss,
+ const std::string &sSymName, SubArguments &vSubArguments) SAL_OVERRIDE;
+ virtual std::string BinFuncName(void) const SAL_OVERRIDE { return "IF"; }
+};
}}
commit c3383aafa18ef9d03b04b2a4719e71fdfabc14eb
Author: haochen <haochen at multicorewareinc.com>
Date: Thu May 29 09:09:55 2014 +0800
GPU Calc:Support string arguments in VLookup
Change-Id: Ic2400a13c07c5b08beccaeffef4899c8f8b43af8
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 4f40e25..c0b62f2 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -378,28 +378,55 @@ size_t DynamicKernelStringArgument::Marshal(cl_kernel k, int argno, int, cl_prog
vRef = pDVR->GetArrays()[mnIndex];
}
size_t szHostBuffer = nStrings * sizeof(cl_int);
- // Marshal strings. Right now we pass hashes of these string
- mpClmem = clCreateBuffer(kEnv.mpkContext,
- (cl_mem_flags) CL_MEM_READ_ONLY|CL_MEM_ALLOC_HOST_PTR,
- szHostBuffer, NULL, &err);
- if (CL_SUCCESS != err)
- throw OpenCLError(err, __FILE__, __LINE__);
- cl_uint *pHashBuffer = (cl_uint*)clEnqueueMapBuffer(
- kEnv.mpkCmdQueue, mpClmem, CL_TRUE, CL_MAP_WRITE, 0,
- szHostBuffer, 0, NULL, NULL, &err);
- if (CL_SUCCESS != err)
- throw OpenCLError(err, __FILE__, __LINE__);
- for (size_t i = 0; i < nStrings; i++)
+ cl_uint *pHashBuffer = NULL;
+
+ if ( vRef.mpStringArray != NULL)
{
- if (vRef.mpStringArray[i])
- {
- const OUString tmp = OUString(vRef.mpStringArray[i]);
- pHashBuffer[i] = tmp.hashCode();
- }
- else
+ // Marshal strings. Right now we pass hashes of these string
+ mpClmem = clCreateBuffer(kEnv.mpkContext,
+ (cl_mem_flags) CL_MEM_READ_ONLY|CL_MEM_ALLOC_HOST_PTR,
+ szHostBuffer, NULL, &err);
+ if (CL_SUCCESS != err)
+ throw OpenCLError(err, __FILE__, __LINE__);
+
+ pHashBuffer = (cl_uint*)clEnqueueMapBuffer(
+ kEnv.mpkCmdQueue, mpClmem, CL_TRUE, CL_MAP_WRITE, 0,
+ szHostBuffer, 0, NULL, NULL, &err);
+ if (CL_SUCCESS != err)
+ throw OpenCLError(err, __FILE__, __LINE__);
+
+ for (size_t i = 0; i < nStrings; i++)
{
+ if (vRef.mpStringArray[i])
+ {
+ const OUString tmp = OUString(vRef.mpStringArray[i]);
+ pHashBuffer[i] = tmp.hashCode();
+ }
+ else
+ {
+ pHashBuffer[i] = 0;
+ }
+ }
+ }
+ else
+ {
+ if (nStrings == 0)
+ szHostBuffer = sizeof(cl_int); // a dummy small value
+ // Marshal as a buffer of NANs
+ mpClmem = clCreateBuffer(kEnv.mpkContext,
+ (cl_mem_flags) CL_MEM_READ_ONLY|CL_MEM_ALLOC_HOST_PTR,
+ szHostBuffer, NULL, &err);
+ if (CL_SUCCESS != err)
+ throw OpenCLError(err, __FILE__, __LINE__);
+
+ cl_uint *pHashBuffer = (cl_uint*)clEnqueueMapBuffer(
+ kEnv.mpkCmdQueue, mpClmem, CL_TRUE, CL_MAP_WRITE, 0,
+ szHostBuffer, 0, NULL, NULL, &err);
+ if (CL_SUCCESS != err)
+ throw OpenCLError(err, __FILE__, __LINE__);
+
+ for (size_t i = 0; i < szHostBuffer/sizeof(cl_int); i++)
pHashBuffer[i] = 0;
- }
}
err = clEnqueueUnmapMemObject(kEnv.mpkCmdQueue, mpClmem,
pHashBuffer, 0, NULL, NULL);
@@ -425,6 +452,7 @@ public:
ss << ", ";
mStringArgument.GenSlidingWindowDecl(ss);
}
+ virtual bool IsMixedArgument() const SAL_OVERRIDE {return true;}
virtual void GenSlidingWindowFunction(std::stringstream &) SAL_OVERRIDE {}
/// Generate declaration
virtual void GenDecl(std::stringstream &ss) const SAL_OVERRIDE
@@ -439,12 +467,20 @@ public:
ss << ",";
mStringArgument.GenDeclRef(ss);
}
- virtual std::string GenSlidingWindowDeclRef(bool) const SAL_OVERRIDE
+ virtual void GenNumDeclRef(std::stringstream& ss) const SAL_OVERRIDE
+ {
+ VectorRef::GenSlidingWindowDecl(ss);
+ }
+ virtual void GenStringDeclRef(std::stringstream& ss) const SAL_OVERRIDE
+ {
+ mStringArgument.GenSlidingWindowDecl(ss);
+ }
+ virtual std::string GenSlidingWindowDeclRef(bool nested) const SAL_OVERRIDE
{
std::stringstream ss;
ss << "(!isNan(" << VectorRef::GenSlidingWindowDeclRef();
ss << ")?" << VectorRef::GenSlidingWindowDeclRef();
- ss << ":" << mStringArgument.GenSlidingWindowDeclRef();
+ ss << ":" << mStringArgument.GenSlidingWindowDeclRef(nested);
ss << ")";
return ss.str();
}
@@ -725,15 +761,16 @@ public:
ss << ",";
mStringArgument.GenDeclRef(ss);
}
- virtual std::string GenSlidingWindowDeclRef(bool) const SAL_OVERRIDE
+ virtual std::string GenSlidingWindowDeclRef(bool nested) const SAL_OVERRIDE
{
std::stringstream ss;
ss << "(!isNan(" << mDoubleArgument.GenSlidingWindowDeclRef();
ss << ")?" << mDoubleArgument.GenSlidingWindowDeclRef();
- ss << ":" << mStringArgument.GenSlidingWindowDeclRef();
+ ss << ":" << mStringArgument.GenSlidingWindowDeclRef(nested);
ss << ")";
return ss.str();
}
+ virtual bool IsMixedArgument() const SAL_OVERRIDE {return true;}
virtual std::string GenDoubleSlidingWindowDeclRef(bool=false) const SAL_OVERRIDE
{
std::stringstream ss;
@@ -746,6 +783,14 @@ public:
ss << mStringArgument.GenSlidingWindowDeclRef();
return ss.str();
}
+ virtual void GenNumDeclRef(std::stringstream& ss) const SAL_OVERRIDE
+ {
+ mDoubleArgument.GenDeclRef(ss);
+ }
+ virtual void GenStringDeclRef(std::stringstream& ss) const SAL_OVERRIDE
+ {
+ mStringArgument.GenDeclRef(ss);
+ }
virtual size_t Marshal(cl_kernel k, int argno, int vw, cl_program p) SAL_OVERRIDE
{
int i = mDoubleArgument.Marshal(k, argno, vw, p);
diff --git a/sc/source/core/opencl/op_spreadsheet.cxx b/sc/source/core/opencl/op_spreadsheet.cxx
index d2b78c9..3610850 100644
--- a/sc/source/core/opencl/op_spreadsheet.cxx
+++ b/sc/source/core/opencl/op_spreadsheet.cxx
@@ -157,10 +157,32 @@ void OpVLookup::GenSlidingWindowFunction(std::stringstream &ss,
ss << " == ";
ss << j+1;
ss << ")\n";
- ss << " tmp = ";
- vSubArguments[1+j]->GenDeclRef(ss);
- ss << "[rowNum];\n";
+ if( !(vSubArguments[1+j]->IsMixedArgument()))
+ {
+ ss << "{";
+ ss << " tmp = ";
+ vSubArguments[1+j]->GenDeclRef(ss);
+ ss << "[rowNum];\n";
+ ss << "}";
+
+ }
+ else
+ {
+ ss << "{";
+
+ ss << " tmp = isNan(";
+ vSubArguments[1+j]->GenNumDeclRef(ss);
+ ss << "[rowNum]"<<")?";
+ vSubArguments[1+j]->GenNumDeclRef(ss);
+ ss << "[rowNum]:";
+ vSubArguments[1+j]->GenStringDeclRef(ss);
+ ss << "[rowNum];\n";
+ ss << "}";
+
+
+
+ }
}
ss << " return tmp;\n";
ss << " }\n";
@@ -221,9 +243,24 @@ void OpVLookup::GenSlidingWindowFunction(std::stringstream &ss,
ss << " == ";
ss << j+1;
ss << ")\n";
- ss << " tmp = ";
- vSubArguments[1+j]->GenDeclRef(ss);
- ss << "[rowNum];\n";
+ ///Add MixedArguments for string support in Vlookup.
+ if( !(vSubArguments[1+j]->IsMixedArgument()))
+ {
+ ss << " tmp = ";
+ vSubArguments[1+j]->GenDeclRef(ss);
+ ss << "[rowNum];\n";
+ }
+ else
+ {
+ ss << " tmp = isNan(";
+ vSubArguments[1+j]->GenNumDeclRef(ss);
+ ss << "[rowNum]"<<")?";
+ vSubArguments[1+j]->GenNumDeclRef(ss);
+ ss << "[rowNum]:";
+ vSubArguments[1+j]->GenStringDeclRef(ss);
+ ss << "[rowNum];\n";
+ }
+
}
ss << " return tmp;\n";
diff --git a/sc/source/core/opencl/op_spreadsheet.hxx b/sc/source/core/opencl/op_spreadsheet.hxx
index 53a0109..0179506 100644
--- a/sc/source/core/opencl/op_spreadsheet.hxx
+++ b/sc/source/core/opencl/op_spreadsheet.hxx
@@ -20,6 +20,7 @@ public:
virtual void GenSlidingWindowFunction(std::stringstream &ss,
const std::string &sSymName, SubArguments &vSubArguments) SAL_OVERRIDE;
virtual std::string BinFuncName(void) const SAL_OVERRIDE { return "VLookup"; }
+ virtual bool takeString() const SAL_OVERRIDE { return true; }
};
}}
diff --git a/sc/source/core/opencl/opbase.cxx b/sc/source/core/opencl/opbase.cxx
index dfda160..ccd653c 100644
--- a/sc/source/core/opencl/opbase.cxx
+++ b/sc/source/core/opencl/opbase.cxx
@@ -59,15 +59,15 @@ void VectorRef::GenSlidingWindowDecl(std::stringstream &ss) const
}
/// When referenced in a sliding window function
-std::string VectorRef::GenSlidingWindowDeclRef(bool) const
+std::string VectorRef::GenSlidingWindowDeclRef(bool nested) const
{
std::stringstream ss;
formula::SingleVectorRefToken *pSVR =
dynamic_cast<formula::SingleVectorRefToken*>(DynamicKernelArgument::GetFormulaToken());
- if (pSVR)
+ if (pSVR&&nested)
ss << "(gid0 < " << pSVR->GetArrayLength() << "?";
ss << mSymName << "[gid0]";
- if (pSVR)
+ if (pSVR&&nested)
ss << ":NAN)";
return ss.str();
}
@@ -155,7 +155,7 @@ void CheckVariables::CheckSubArgumentIsNan( std::stringstream & ss,
ss<< " if(";
}
ss<< "isNan(";
- ss<< vSubArguments[i]->GenSlidingWindowDeclRef();
+ ss<< vSubArguments[i]->GenSlidingWindowDeclRef(false);
ss<<"))\n";
ss<< " tmp";
ss<< i;
@@ -164,7 +164,7 @@ void CheckVariables::CheckSubArgumentIsNan( std::stringstream & ss,
ss <<" tmp";
ss <<i;
ss << "=";
- ss << vSubArguments[i]->GenSlidingWindowDeclRef();
+ ss << vSubArguments[i]->GenSlidingWindowDeclRef(false);
ss<<";\n";
}
diff --git a/sc/source/core/opencl/opbase.hxx b/sc/source/core/opencl/opbase.hxx
index 6cd04a9..d1d0005 100644
--- a/sc/source/core/opencl/opbase.hxx
+++ b/sc/source/core/opencl/opbase.hxx
@@ -165,8 +165,14 @@ public:
virtual std::string GenStringSlidingWindowDeclRef(bool=false) const
{ return std::string(""); }
+ virtual bool IsMixedArgument() const
+ { return false; }
+
/// Generate use/references to the argument
virtual void GenDeclRef(std::stringstream &ss) const;
+ virtual void GenNumDeclRef(std::stringstream &ss) const{ss << ",";}
+
+ virtual void GenStringDeclRef(std::stringstream &ss) const{ss << ",";}
/// Create buffer and pass the buffer to a given kernel
virtual size_t Marshal(cl_kernel, int, int, cl_program) = 0;
@@ -205,7 +211,7 @@ public:
virtual void GenSlidingWindowDecl(std::stringstream &ss) const SAL_OVERRIDE;
/// When referenced in a sliding window function
- virtual std::string GenSlidingWindowDeclRef(bool=false) const SAL_OVERRIDE;
+ virtual std::string GenSlidingWindowDeclRef(bool=true) const SAL_OVERRIDE;
/// Create buffer and pass the buffer to a given kernel
virtual size_t Marshal(cl_kernel, int, int, cl_program) SAL_OVERRIDE;
commit aa294679810972d43f1ad0735319d9a06936210b
Author: weigao <weigao at multicorewareinc.com>
Date: Tue Jun 10 01:18:38 2014 -0700
add global scale matrix
Change-Id: Ied37fdbe92a83ac588ccf14f694ffb53769d92d1
diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index e56d6d7..ad013e9 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -374,6 +374,8 @@ private:
MaterialParameters m_Batchmaterial;
GLuint m_Batch3DUBOBuffer;
GLint m_Batch3DActualSizeLight;
+
+ glm::mat4 m_GlobalScaleMatrix;
};
}
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index dc39999..a7d1496 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -308,6 +308,7 @@ void OpenGL3DRenderer::init()
glViewport(0, 0, m_iWidth, m_iHeight);
Set3DSenceInfo(0xFFFFFF, true);
+ m_GlobalScaleMatrix = glm::scale(0.01f, 0.01f, 0.01f);
}
void OpenGL3DRenderer::SetSize(const Size& rSize)
@@ -724,7 +725,7 @@ void OpenGL3DRenderer::RenderLine3D(const Polygon3DInfo& polygon)
PosVecf3 angle = {0.0f, 0.0f, 0.0f};
PosVecf3 scale = {1.0f, 1.0f, m_fHeightWeight};
MoveModelf(trans, angle, scale);
-
+ m_Model =m_GlobalScaleMatrix * m_Model;
m_3DMVP = m_3DProjection * m_3DView * m_Model;
for (size_t i = 0; i < polygon.verticesList.size(); i++)
@@ -795,6 +796,7 @@ void OpenGL3DRenderer::RenderPolygon3D(const Polygon3DInfo& polygon)
PosVecf3 angle = {0.0f, 0.0f, 0.0f};
PosVecf3 scale = {1.0f, 1.0f, m_fHeightWeight};
MoveModelf(trans, angle, scale);
+ m_Model =m_GlobalScaleMatrix * m_Model;
glm::mat3 normalMatrix(m_Model);
glm::mat3 normalInverseTranspos = glm::inverseTranspose(normalMatrix);
@@ -1219,7 +1221,7 @@ void OpenGL3DRenderer::RenderExtrudeBottomSurface(const Extrude3DInfo& extrude3D
glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z));
m_Model = aTranslationMatrix * extrude3D.rotation * topTrans * topScale;
}
-
+ m_Model =m_GlobalScaleMatrix * m_Model;
if(!mbPickingMode)
{
glm::mat3 normalMatrix(m_Model);
@@ -1264,7 +1266,7 @@ void OpenGL3DRenderer::RenderExtrudeMiddleSurface(const Extrude3DInfo& extrude3D
glm::mat4 reverseMatrix = glm::translate(glm::vec3(0.0, 0.0, -1.0));
m_Model = m_Model * reverseMatrix;
}
-
+ m_Model =m_GlobalScaleMatrix * m_Model;
if(!mbPickingMode)
{
glm::mat3 normalMatrix(m_Model);
@@ -1309,7 +1311,7 @@ void OpenGL3DRenderer::RenderExtrudeTopSurface(const Extrude3DInfo& extrude3D)
glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z));
m_Model = aTranslationMatrix * extrude3D.rotation * topTrans * topScale * orgTrans;
}
-
+ m_Model =m_GlobalScaleMatrix * m_Model;
if(!mbPickingMode)
{
glm::mat3 normalMatrix(m_Model);
@@ -1340,7 +1342,7 @@ void OpenGL3DRenderer::RenderNonRoundedBar(const Extrude3DInfo& extrude3D)
glm::mat4 reverseMatrix = glm::translate(glm::vec3(0.0, 0.0, -1.0));
m_Model = m_Model * reverseMatrix;
}
-
+ m_Model =m_GlobalScaleMatrix * m_Model;
if(!mbPickingMode)
{
glm::mat3 normalMatrix(m_Model);
@@ -1637,6 +1639,7 @@ void OpenGL3DRenderer::RenderTextShape()
PosVecf3 angle = {0.0f, 0.0f, 0.0f};
PosVecf3 scale = {1.0, 1.0, 1.0f};
MoveModelf(trans, angle, scale);
+ m_Model =m_GlobalScaleMatrix * m_Model;
glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model;
glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
CHECK_GL_ERROR();
@@ -1690,6 +1693,8 @@ void OpenGL3DRenderer::RenderTextShape()
void OpenGL3DRenderer::CreateSceneBoxView()
{
+ m_CameraInfo.cameraPos = glm::vec3(m_GlobalScaleMatrix * glm::vec4(m_CameraInfo.cameraPos, 1.0));
+ m_CameraInfo.cameraOrg = glm::vec3(m_GlobalScaleMatrix * glm::vec4(m_CameraInfo.cameraOrg, 1.0));
m_3DView = glm::lookAt(m_CameraInfo.cameraPos,
m_CameraInfo.cameraOrg,
m_CameraInfo.cameraUp);
@@ -1810,6 +1815,7 @@ void OpenGL3DRenderer::GetBatchMiddleInfo(const Extrude3DInfo &extrude3D)
glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z));
m_Model = aTranslationMatrix * extrude3D.rotation * scale;
}
+ m_Model =m_GlobalScaleMatrix * m_Model;
glm::mat3 normalMatrix(m_Model);
glm::mat3 normalInverseTranspos = glm::inverseTranspose(normalMatrix);
m_BarSurface[MIDDLE_SURFACE].modelMatrixList.push_back(m_Model);
@@ -1844,6 +1850,7 @@ void OpenGL3DRenderer::GetBatchTopAndFlatInfo(const Extrude3DInfo &extrude3D)
glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z));
m_Model = aTranslationMatrix * extrude3D.rotation * topTrans * topScale * orgTrans;
}
+ m_Model =m_GlobalScaleMatrix * m_Model;
glm::mat3 normalMatrix(m_Model);
glm::mat3 normalInverseTranspos = glm::inverseTranspose(normalMatrix);
m_BarSurface[TOP_SURFACE].modelMatrixList.push_back(m_Model);
@@ -1853,6 +1860,7 @@ void OpenGL3DRenderer::GetBatchTopAndFlatInfo(const Extrude3DInfo &extrude3D)
glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z));
glm::mat4 flatScale = glm::scale(xyScale, xyScale, xyScale);
m_Model = aTranslationMatrix * extrude3D.rotation * flatScale;
+ m_Model =m_GlobalScaleMatrix * m_Model;
normalMatrix = glm::mat3(m_Model);
normalInverseTranspos = glm::inverseTranspose(normalMatrix);
@@ -1878,6 +1886,7 @@ void OpenGL3DRenderer::GetBatchBarsInfo()
glm::mat4 transformMatrix = glm::translate(glm::vec3(extrude3DInfo.xTransform, extrude3DInfo.yTransform, extrude3DInfo.zTransform));
glm::mat4 scaleMatrix = glm::scale(extrude3DInfo.xScale, extrude3DInfo.yScale, extrude3DInfo.zScale);
m_Model = transformMatrix * extrude3DInfo.rotation * scaleMatrix;
+ m_Model = m_GlobalScaleMatrix * m_Model;
glm::mat3 normalMatrix(m_Model);
glm::mat3 normalInverseTranspos = glm::inverseTranspose(normalMatrix);
m_BarSurface[0].modelMatrixList.push_back(m_Model);
commit 29eceedd7b290ea19aa8deb987b5d6f1fa355198
Author: weigao <weigao at multicorewareinc.com>
Date: Mon Jun 9 23:46:03 2014 -0700
Modified the depth bit to 24
Change-Id: I57387f9250c0c62c3cab7a75571d001fef99fdb4
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 71e9409..548790d 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -204,7 +204,7 @@ bool InitMultisample(PIXELFORMATDESCRIPTOR pfd, int& rPixelFormat)
WGL_ACCELERATION_ARB,WGL_FULL_ACCELERATION_ARB,
WGL_COLOR_BITS_ARB,24,
WGL_ALPHA_BITS_ARB,8,
- WGL_DEPTH_BITS_ARB,16,
+ WGL_DEPTH_BITS_ARB,24,
WGL_STENCIL_BITS_ARB,0,
WGL_DOUBLE_BUFFER_ARB,GL_TRUE,
WGL_SAMPLE_BUFFERS_ARB,GL_TRUE,
commit 9284a63adddde51ceb4730b870391b1e2af3de4a
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Mon Jun 9 11:27:28 2014 +0200
iprevent violation of exception spec
Change-Id: I1f638ae3a2e88e0cadaab0046ef087fe77e16b06
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 78fbb35..01250f4 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -2434,7 +2434,12 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name )
aFile = aElementName;
aFile += ".";
aFile += maLibElementFileExtension;
- xElementStream = xLibraryStor->openStreamElement( aFile, embed::ElementModes::READ );
+ try
+ {
+ xElementStream = xLibraryStor->openStreamElement( aFile, embed::ElementModes::READ );
+ }
+ catch(const uno::Exception& )
+ {}
}
if ( xElementStream.is() )
More information about the Libreoffice-commits
mailing list