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

Side by Side Diff: experimental/webtry/template.cpp

Issue 228693002: Initial code for webtry, a web application for allowing users to try out Skia. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Don't add webtry to everything.gyp Created 6 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 #include "SkCanvas.h"
2 #include "SkGraphics.h"
3 #include "SkImageEncoder.h"
4 #include "SkImageInfo.h"
5 #include "SkForceLinking.h"
6
7 int main() {
8 SkForceLinking(false);
9 SkGraphics::Init();
10
11 SkImageInfo info = SkImageInfo::MakeN32(300, 300, kPremul_SkAlphaType);
12 SkBitmap bitmap;
13 bitmap.setConfig(info);
14 bitmap.allocPixels();
15 SkCanvas c(bitmap);
16 c.drawColor(SK_ColorWHITE);
17
18 $usercode
19
20 if (!SkImageEncoder::EncodeFile("foo.png", bitmap, SkImageEncoder::kPNG_Type , 100)) {
21 printf("Failed to encode\n");
22 }
23 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698