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

Side by Side Diff: experimental/SkiaExamples/SkExample.cpp

Issue 22978012: Split SkDevice into SkBaseDevice and SkBitmapDevice (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Updating to ToT (10994) Created 7 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 | Annotate | Revision Log
« no previous file with comments | « experimental/PdfViewer/pdf_viewer_main.cpp ('k') | experimental/iOSSampleApp/SkSampleUIView.mm » ('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 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 * 7 *
8 */ 8 */
9 9
10 #include "SkExample.h" 10 #include "SkExample.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 desc.fRenderTargetHandle = buffer; 108 desc.fRenderTargetHandle = buffer;
109 109
110 fRenderTarget = fContext->wrapBackendRenderTarget(desc); 110 fRenderTarget = fContext->wrapBackendRenderTarget(desc);
111 111
112 fContext->setRenderTarget(fRenderTarget); 112 fContext->setRenderTarget(fRenderTarget);
113 } 113 }
114 114
115 SkCanvas* SkExampleWindow::createCanvas() { 115 SkCanvas* SkExampleWindow::createCanvas() {
116 if (fType == kGPU_DeviceType) { 116 if (fType == kGPU_DeviceType) {
117 if (NULL != fContext && NULL != fRenderTarget) { 117 if (NULL != fContext && NULL != fRenderTarget) {
118 SkAutoTUnref<SkDevice> device(new SkGpuDevice(fContext, fRenderTarge t)); 118 SkAutoTUnref<SkBaseDevice> device(new SkGpuDevice(fContext, fRenderT arget));
119 return new SkCanvas(device); 119 return new SkCanvas(device);
120 } 120 }
121 tearDownBackend(); 121 tearDownBackend();
122 setupBackend(kRaster_DeviceType); 122 setupBackend(kRaster_DeviceType);
123 } 123 }
124 return INHERITED::createCanvas(); 124 return INHERITED::createCanvas();
125 } 125 }
126 126
127 void SkExampleWindow::draw(SkCanvas* canvas) { 127 void SkExampleWindow::draw(SkCanvas* canvas) {
128 if (NULL != fCurrExample) { 128 if (NULL != fCurrExample) {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 SkDebugf("No SkExample that matches your query\n"); 188 SkDebugf("No SkExample that matches your query\n");
189 } 189 }
190 } 190 }
191 return true; 191 return true;
192 } 192 }
193 193
194 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { 194 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) {
195 SkCommandLineFlags::Parse(argc, argv); 195 SkCommandLineFlags::Parse(argc, argv);
196 return new SkExampleWindow(hwnd); 196 return new SkExampleWindow(hwnd);
197 } 197 }
OLDNEW
« no previous file with comments | « experimental/PdfViewer/pdf_viewer_main.cpp ('k') | experimental/iOSSampleApp/SkSampleUIView.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698