OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "HelloWorld.h" | 10 #include "HelloWorld.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 INHERITED::detach(); | 52 INHERITED::detach(); |
53 } | 53 } |
54 | 54 |
55 void HelloWorldWindow::setTitle() { | 55 void HelloWorldWindow::setTitle() { |
56 SkString title("Hello World "); | 56 SkString title("Hello World "); |
57 title.appendf(fType == kRaster_DeviceType ? "raster" : "opengl"); | 57 title.appendf(fType == kRaster_DeviceType ? "raster" : "opengl"); |
58 INHERITED::setTitle(title.c_str()); | 58 INHERITED::setTitle(title.c_str()); |
59 } | 59 } |
60 | 60 |
61 bool HelloWorldWindow::setUpBackend() { | 61 bool HelloWorldWindow::setUpBackend() { |
62 this->setColorType(kRGBA_8888_SkColorType); | |
63 this->setVisibleP(true); | 62 this->setVisibleP(true); |
64 this->setClipToBounds(false); | 63 this->setClipToBounds(false); |
65 | 64 |
66 bool result = attach(kNativeGL_BackEndType, 0 /*msaa*/, &fAttachmentInfo); | 65 bool result = attach(kNativeGL_BackEndType, 0 /*msaa*/, &fAttachmentInfo); |
67 if (false == result) { | 66 if (false == result) { |
68 SkDebugf("Not possible to create backend.\n"); | 67 SkDebugf("Not possible to create backend.\n"); |
69 detach(); | 68 detach(); |
70 return false; | 69 return false; |
71 } | 70 } |
72 | 71 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 setUpBackend(); | 183 setUpBackend(); |
185 this->setTitle(); | 184 this->setTitle(); |
186 this->inval(NULL); | 185 this->inval(NULL); |
187 } | 186 } |
188 return true; | 187 return true; |
189 } | 188 } |
190 | 189 |
191 SkOSWindow* create_sk_window(void* hwnd, int , char** ) { | 190 SkOSWindow* create_sk_window(void* hwnd, int , char** ) { |
192 return new HelloWorldWindow(hwnd); | 191 return new HelloWorldWindow(hwnd); |
193 } | 192 } |
OLD | NEW |