Index: bench/PremulAndUnpremulAlphaOpsBench.cpp |
diff --git a/bench/PremulAndUnpremulAlphaOpsBench.cpp b/bench/PremulAndUnpremulAlphaOpsBench.cpp |
index 93c84c9095810ef33c2107fc98c81830f7a57133..4afa43fe6ebfee0c87ba1ce3f03dea70e25dd9d0 100644 |
--- a/bench/PremulAndUnpremulAlphaOpsBench.cpp |
+++ b/bench/PremulAndUnpremulAlphaOpsBench.cpp |
@@ -1,4 +1,3 @@ |
- |
/* |
* Copyright 2013 Google Inc. |
* |
@@ -10,6 +9,7 @@ |
#include "SkCanvas.h" |
#include "SkConfig8888.h" |
#include "SkString.h" |
+#include "sk_tool_utils.h" |
class PremulAndUnpremulAlphaOpsBench : public SkBenchmark { |
public: |
@@ -45,9 +45,16 @@ protected: |
bmp2.setConfig(SkBitmap::kARGB_8888_Config, size.width(), |
size.height()); |
+ SkColorType ct; |
+ SkAlphaType at; |
+ sk_tool_utils::config8888_to_imagetypes(fUnPremulConfig, &ct, &at); |
+ if (bmp1.isOpaque()) { |
+ at = kOpaque_SkAlphaType; |
+ } |
+ |
for (int loop = 0; loop < loops; ++loop) { |
// Unpremul -> Premul |
- canvas->writePixels(bmp1, 0, 0, fUnPremulConfig); |
+ sk_tool_utils::write_pixels(canvas, bmp1, 0, 0, ct, at); |
// Premul -> Unpremul |
canvas->readPixels(&bmp2, 0, 0, fUnPremulConfig); |
} |