Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2370)

Unified Diff: experimental/webtry/template.cpp

Issue 195143004: First pass at a web app that lets you run Skia code and see the results. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove stray png Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/webtry/server.py ('k') | gyp/everything.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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");
+ }
+}
« no previous file with comments | « experimental/webtry/server.py ('k') | gyp/everything.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698