| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 virtual void publishCanvas(SampleWindow::DeviceType dType, | 285 virtual void publishCanvas(SampleWindow::DeviceType dType, |
| 286 SkCanvas* canvas, | 286 SkCanvas* canvas, |
| 287 SampleWindow* win) { | 287 SampleWindow* win) { |
| 288 #if SK_SUPPORT_GPU | 288 #if SK_SUPPORT_GPU |
| 289 if (fCurContext) { | 289 if (fCurContext) { |
| 290 // in case we have queued drawing calls | 290 // in case we have queued drawing calls |
| 291 fCurContext->flush(); | 291 fCurContext->flush(); |
| 292 | 292 |
| 293 if (!IsGpuDeviceType(dType)) { | 293 if (!IsGpuDeviceType(dType)) { |
| 294 // need to send the raster bits to the (gpu) window | 294 // need to send the raster bits to the (gpu) window |
| 295 fCurContext->setRenderTarget(fCurRenderTarget); | |
| 296 const SkBitmap& bm = win->getBitmap(); | 295 const SkBitmap& bm = win->getBitmap(); |
| 297 fCurRenderTarget->writePixels(0, 0, bm.width(), bm.height(), | 296 fCurRenderTarget->writePixels(0, 0, bm.width(), bm.height(), |
| 298 SkImageInfo2GrPixelConfig(bm.colorT
ype(), | 297 SkImageInfo2GrPixelConfig(bm.colorT
ype(), |
| 299 bm.alphaT
ype(), | 298 bm.alphaT
ype(), |
| 300 bm.profil
eType()), | 299 bm.profil
eType()), |
| 301 bm.getPixels(), | 300 bm.getPixels(), |
| 302 bm.rowBytes(), | 301 bm.rowBytes(), |
| 303 GrContext::kFlushWrites_PixelOp); | 302 GrContext::kFlushWrites_PixelOp); |
| 304 } | 303 } |
| 305 } | 304 } |
| (...skipping 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2368 setenv("ANDROID_ROOT", "/android/device/data", 0); | 2367 setenv("ANDROID_ROOT", "/android/device/data", 0); |
| 2369 #endif | 2368 #endif |
| 2370 SkGraphics::Init(); | 2369 SkGraphics::Init(); |
| 2371 SkEvent::Init(); | 2370 SkEvent::Init(); |
| 2372 } | 2371 } |
| 2373 | 2372 |
| 2374 void application_term() { | 2373 void application_term() { |
| 2375 SkEvent::Term(); | 2374 SkEvent::Term(); |
| 2376 SkGraphics::Term(); | 2375 SkGraphics::Term(); |
| 2377 } | 2376 } |
| OLD | NEW |