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

Side by Side Diff: samplecode/SampleApp.cpp

Issue 939623005: Pass Rendertarget into context (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: sampleapp Created 5 years, 10 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
« no previous file with comments | « include/gpu/SkGr.h ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « include/gpu/SkGr.h ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698