Commits

s...@openoffice.org  committed 74d7ca1

sb140: #i116872# optimize for nOpacity == 0 (requested by aw)

  • Participants
  • Parent commits de8f685

Comments (0)

Files changed (1)

File drawinglayer/source/processor3d/zbufferprocessor3d.cxx

 							}
 
 							nOpacity = nOpacity / nDivisor;
-                            pContent->SetPixel(y, x, BitmapColor(
-                                (sal_uInt8)(nRed / nDivisor),
-                                (sal_uInt8)(nGreen / nDivisor),
-                                (sal_uInt8)(nBlue / nDivisor)));
-                            pAlpha->SetPixel(y, x, BitmapColor(255 - (sal_uInt8)nOpacity));
+                            if(nOpacity)
+                            {
+                                pContent->SetPixel(y, x, BitmapColor(
+                                    (sal_uInt8)(nRed / nDivisor),
+                                    (sal_uInt8)(nGreen / nDivisor),
+                                    (sal_uInt8)(nBlue / nDivisor)));
+                                pAlpha->SetPixel(
+                                    y, x,
+                                    BitmapColor(255 - (sal_uInt8)nOpacity));
+                            }
+                            else
+                            {
+                                pContent->SetPixel(y, x, BitmapColor(0, 0, 0));
+                                pAlpha->SetPixel(y, x, BitmapColor(255));
+                            }
 						}
 					}
 				}