Index: experimental/webtry/template.cpp |
diff --git a/experimental/webtry/template.cpp b/experimental/webtry/template.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..20b9086cde90c35f4132c4155df2d8d4b798f0ca |
--- /dev/null |
+++ b/experimental/webtry/template.cpp |
@@ -0,0 +1,23 @@ |
+#include "SkCanvas.h" |
+#include "SkGraphics.h" |
+#include "SkImageEncoder.h" |
+#include "SkImageInfo.h" |
+#include "SkForceLinking.h" |
+ |
+int main() { |
+ SkForceLinking(false); |
+ SkGraphics::Init(); |
+ |
+ SkImageInfo info = SkImageInfo::MakeN32(300, 300, kPremul_SkAlphaType); |
+ SkBitmap bitmap; |
+ bitmap.setConfig(info); |
+ bitmap.allocPixels(); |
+ SkCanvas c(bitmap); |
+ c.drawColor(SK_ColorWHITE); |
+ |
+ $usercode |
+ |
+ if (!SkImageEncoder::EncodeFile("foo.png", bitmap, SkImageEncoder::kPNG_Type, 100)) { |
+ printf("Failed to encode\n"); |
+ } |
+} |