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 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1355 int index = 0; | 1355 int index = 0; |
1356 for (int y = 0; y < 2; ++y) { | 1356 for (int y = 0; y < 2; ++y) { |
1357 for (int x = 0; x < 2; ++x) { | 1357 for (int x = 0; x < 2; ++x) { |
1358 char* p = (char*)addr; | 1358 char* p = (char*)addr; |
1359 p += y * n.height() * rowBytes; | 1359 p += y * n.height() * rowBytes; |
1360 p += x * n.width() * sizeof(SkPMColor); | 1360 p += x * n.width() * sizeof(SkPMColor); |
1361 surfs[index] = SkSurface::NewRasterDirect(n, p, rowB
ytes); | 1361 surfs[index] = SkSurface::NewRasterDirect(n, p, rowB
ytes); |
1362 SkCanvas* c = surfs[index]->getCanvas(); | 1362 SkCanvas* c = surfs[index]->getCanvas(); |
1363 c->translate(SkIntToScalar(-x * n.width()), | 1363 c->translate(SkIntToScalar(-x * n.width()), |
1364 SkIntToScalar(-y * n.height())); | 1364 SkIntToScalar(-y * n.height())); |
| 1365 c->concat(orig->getTotalMatrix()); |
1365 md.add(c, picture, NULL, NULL); | 1366 md.add(c, picture, NULL, NULL); |
1366 index++; | 1367 index++; |
1367 } | 1368 } |
1368 } | 1369 } |
1369 md.draw(); | 1370 md.draw(); |
1370 for (int i = 0; i < 4; ++i) { | 1371 for (int i = 0; i < 4; ++i) { |
1371 surfs[i]->unref(); | 1372 surfs[i]->unref(); |
1372 } | 1373 } |
1373 } | 1374 } |
1374 } else { | 1375 } else { |
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2427 setenv("ANDROID_ROOT", "/android/device/data", 0); | 2428 setenv("ANDROID_ROOT", "/android/device/data", 0); |
2428 #endif | 2429 #endif |
2429 SkGraphics::Init(); | 2430 SkGraphics::Init(); |
2430 SkEvent::Init(); | 2431 SkEvent::Init(); |
2431 } | 2432 } |
2432 | 2433 |
2433 void application_term() { | 2434 void application_term() { |
2434 SkEvent::Term(); | 2435 SkEvent::Term(); |
2435 SkGraphics::Term(); | 2436 SkGraphics::Term(); |
2436 } | 2437 } |
OLD | NEW |