OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SampleApp.h" | 8 #include "SampleApp.h" |
9 | 9 |
10 #include "OverView.h" | 10 #include "OverView.h" |
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1221 | 1221 |
1222 if (fRequestGrabImage) { | 1222 if (fRequestGrabImage) { |
1223 fRequestGrabImage = false; | 1223 fRequestGrabImage = false; |
1224 | 1224 |
1225 SkBitmap bmp = capture_bitmap(orig); | 1225 SkBitmap bmp = capture_bitmap(orig); |
1226 if (!bmp.isNull()) { | 1226 if (!bmp.isNull()) { |
1227 static int gSampleGrabCounter; | 1227 static int gSampleGrabCounter; |
1228 SkString name; | 1228 SkString name; |
1229 name.printf("sample_grab_%d.png", gSampleGrabCounter++); | 1229 name.printf("sample_grab_%d.png", gSampleGrabCounter++); |
1230 SkImageEncoder::EncodeFile(name.c_str(), bmp, | 1230 SkImageEncoder::EncodeFile(name.c_str(), bmp, |
1231 SkImageEncoder::kPNG_Type, 100); | 1231 kPNG_SkEncodedFormat, 100); |
1232 } | 1232 } |
1233 } | 1233 } |
1234 | 1234 |
1235 if (kPicture_DeviceType == fDeviceType) { | 1235 if (kPicture_DeviceType == fDeviceType) { |
1236 SkAutoTUnref<const SkPicture> picture(fRecorder.endRecording()); | 1236 SkAutoTUnref<const SkPicture> picture(fRecorder.endRecording()); |
1237 | 1237 |
1238 if (true) { | 1238 if (true) { |
1239 this->installDrawFilter(orig); | 1239 this->installDrawFilter(orig); |
1240 | 1240 |
1241 if (true) { | 1241 if (true) { |
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2285 setenv("ANDROID_ROOT", "/android/device/data", 0); | 2285 setenv("ANDROID_ROOT", "/android/device/data", 0); |
2286 #endif | 2286 #endif |
2287 SkGraphics::Init(); | 2287 SkGraphics::Init(); |
2288 SkEvent::Init(); | 2288 SkEvent::Init(); |
2289 } | 2289 } |
2290 | 2290 |
2291 void application_term() { | 2291 void application_term() { |
2292 SkEvent::Term(); | 2292 SkEvent::Term(); |
2293 SkGraphics::Term(); | 2293 SkGraphics::Term(); |
2294 } | 2294 } |
OLD | NEW |