Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 #ifdef PIPE_NET | 79 #ifdef PIPE_NET |
| 80 #include "SkSockets.h" | 80 #include "SkSockets.h" |
| 81 SkTCPServer gServer; | 81 SkTCPServer gServer; |
| 82 #endif | 82 #endif |
| 83 | 83 |
| 84 #if SK_COMMAND_BUFFER | 84 #if SK_COMMAND_BUFFER |
| 85 #define DEFAULT_TO_COMMAND_BUFFER 1 | 85 #define DEFAULT_TO_COMMAND_BUFFER 1 |
| 86 #elif SK_ANGLE | 86 #elif SK_ANGLE |
| 87 //#define DEFAULT_TO_ANGLE 1 | 87 //#define DEFAULT_TO_ANGLE 1 |
| 88 #else | 88 #else |
| 89 #define DEFAULT_TO_GPU 0 // if 1 default rendering is on GPU | 89 #define DEFAULT_TO_GPU 1 // if 1 default rendering is on GPU |
| 90 #endif | 90 #endif |
| 91 | 91 |
| 92 #define ANIMATING_EVENTTYPE "nextSample" | 92 #define ANIMATING_EVENTTYPE "nextSample" |
| 93 #define ANIMATING_DELAY 250 | 93 #define ANIMATING_DELAY 250 |
| 94 | 94 |
| 95 #ifdef SK_DEBUG | 95 #ifdef SK_DEBUG |
| 96 #define FPS_REPEAT_MULTIPLIER 1 | 96 #define FPS_REPEAT_MULTIPLIER 1 |
| 97 #else | 97 #else |
| 98 #define FPS_REPEAT_MULTIPLIER 10 | 98 #define FPS_REPEAT_MULTIPLIER 10 |
| 99 #endif | 99 #endif |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 236 glInterface.reset(GrGLCreateCommandBufferInterface()); | 236 glInterface.reset(GrGLCreateCommandBufferInterface()); |
| 237 break; | 237 break; |
| 238 #endif // SK_COMMAND_BUFFER | 238 #endif // SK_COMMAND_BUFFER |
| 239 default: | 239 default: |
| 240 SkASSERT(false); | 240 SkASSERT(false); |
| 241 break; | 241 break; |
| 242 } | 242 } |
| 243 | 243 |
| 244 // Currently SampleApp does not use NVPR. TODO: Provide an NVPR device t ype that is skipped | 244 // Currently SampleApp does not use NVPR. TODO: Provide an NVPR device t ype that is skipped |
| 245 // when the driver doesn't support NVPR. | 245 // when the driver doesn't support NVPR. |
| 246 fCurIntf = GrGLInterfaceRemoveNVPR(glInterface.get()); | 246 fCurIntf = SkRef/*GrGLInterfaceRemoveNVPR*/(glInterface.get()); |
|
Mark Kilgard
2015/10/01 17:33:24
would it be good to have a command line to SampleA
Chris Dalton
2015/10/03 16:39:20
Oops, that was an accidental hack that found its w
| |
| 247 | 247 |
| 248 SkASSERT(nullptr == fCurContext); | 248 SkASSERT(nullptr == fCurContext); |
| 249 fCurContext = GrContext::Create(kOpenGL_GrBackend, (GrBackendContext) fC urIntf); | 249 fCurContext = GrContext::Create(kOpenGL_GrBackend, (GrBackendContext) fC urIntf); |
| 250 | 250 |
| 251 if (nullptr == fCurContext || nullptr == fCurIntf) { | 251 if (nullptr == fCurContext || nullptr == fCurIntf) { |
| 252 // We need some context and interface to see results | 252 // We need some context and interface to see results |
| 253 SkSafeUnref(fCurContext); | 253 SkSafeUnref(fCurContext); |
| 254 SkSafeUnref(fCurIntf); | 254 SkSafeUnref(fCurIntf); |
| 255 fCurContext = nullptr; | 255 fCurContext = nullptr; |
| 256 fCurIntf = nullptr; | 256 fCurIntf = nullptr; |
| (...skipping 2134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2391 #ifdef SK_BUILD_FOR_MAC | 2391 #ifdef SK_BUILD_FOR_MAC |
| 2392 setenv("ANDROID_ROOT", "/android/device/data", 0); | 2392 setenv("ANDROID_ROOT", "/android/device/data", 0); |
| 2393 #endif | 2393 #endif |
| 2394 SkGraphics::Init(); | 2394 SkGraphics::Init(); |
| 2395 SkEvent::Init(); | 2395 SkEvent::Init(); |
| 2396 } | 2396 } |
| 2397 | 2397 |
| 2398 void application_term() { | 2398 void application_term() { |
| 2399 SkEvent::Term(); | 2399 SkEvent::Term(); |
| 2400 } | 2400 } |
| OLD | NEW |