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

Side by Side Diff: samplecode/SampleApp.cpp

Issue 580073003: use surface in SkView/SampleApp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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
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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 263
264 SkSafeUnref(fCurIntf); 264 SkSafeUnref(fCurIntf);
265 fCurIntf = NULL; 265 fCurIntf = NULL;
266 266
267 SkSafeUnref(fCurRenderTarget); 267 SkSafeUnref(fCurRenderTarget);
268 fCurRenderTarget = NULL; 268 fCurRenderTarget = NULL;
269 #endif 269 #endif
270 win->detach(); 270 win->detach();
271 fBackend = kNone_BackEndType; 271 fBackend = kNone_BackEndType;
272 } 272 }
273 273
robertphillips 2014/09/18 14:52:21 SK_OVERRIDE ?
reed1 2014/09/18 18:08:12 Done.
274 virtual SkCanvas* createCanvas(SampleWindow::DeviceType dType, 274 virtual SkSurface* createSurface(SampleWindow::DeviceType dType, SampleWindo w* win) {
275 SampleWindow* win) {
276 #if SK_SUPPORT_GPU 275 #if SK_SUPPORT_GPU
277 if (IsGpuDeviceType(dType) && fCurContext) { 276 if (IsGpuDeviceType(dType) && fCurContext) {
278 SkAutoTUnref<SkBaseDevice> device(SkGpuDevice::Create(fCurRenderTarg et)); 277 return SkSurface::NewRenderTargetDirect(fCurRenderTarget);
279 return new SkCanvas(device);
280 } else 278 } else
281 #endif 279 #endif
282 { 280 {
283 return NULL; 281 return NULL;
284 } 282 }
285 } 283 }
286 284
287 virtual void publishCanvas(SampleWindow::DeviceType dType, 285 virtual void publishCanvas(SampleWindow::DeviceType dType,
288 SkCanvas* canvas, 286 SkCanvas* canvas,
289 SampleWindow* win) { 287 SampleWindow* win) {
(...skipping 2106 matching lines...) Expand 10 before | Expand all | Expand 10 after
2396 setenv("ANDROID_ROOT", "/android/device/data", 0); 2394 setenv("ANDROID_ROOT", "/android/device/data", 0);
2397 #endif 2395 #endif
2398 SkGraphics::Init(); 2396 SkGraphics::Init();
2399 SkEvent::Init(); 2397 SkEvent::Init();
2400 } 2398 }
2401 2399
2402 void application_term() { 2400 void application_term() {
2403 SkEvent::Term(); 2401 SkEvent::Term();
2404 SkGraphics::Term(); 2402 SkGraphics::Term();
2405 } 2403 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698