OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |