diff options
author | halcanary <halcanary@google.com> | 2015-08-27 07:41:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-27 07:41:16 -0700 |
commit | 96fcdcc219d2a0d3579719b84b28bede76efba64 (patch) | |
tree | 0ec5ea0193d8292df8bf5ed9dd8498a5eb5763dd /platform_tools | |
parent | 435af2f736c85c3274a0c6760a3523810750d237 (diff) |
Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002
Review URL: https://codereview.chromium.org/1316233002
Diffstat (limited to 'platform_tools')
3 files changed, 29 insertions, 29 deletions
diff --git a/platform_tools/android/apps/sample_app/src/main/jni/com_skia_SkiaSampleRenderer.cpp b/platform_tools/android/apps/sample_app/src/main/jni/com_skia_SkiaSampleRenderer.cpp index d66221a01c..15f01a94bf 100644 --- a/platform_tools/android/apps/sample_app/src/main/jni/com_skia_SkiaSampleRenderer.cpp +++ b/platform_tools/android/apps/sample_app/src/main/jni/com_skia_SkiaSampleRenderer.cpp @@ -29,11 +29,11 @@ struct ActivityGlue { jmethodID m_setSlideList; jmethodID m_addToDownloads; ActivityGlue() { - m_env = NULL; - m_obj = NULL; - m_setTitle = NULL; - m_setSlideList = NULL; - m_addToDownloads = NULL; + m_env = nullptr; + m_obj = nullptr; + m_setTitle = nullptr; + m_setSlideList = nullptr; + m_addToDownloads = nullptr; } } gActivityGlue; @@ -44,11 +44,11 @@ struct WindowGlue { jmethodID m_startTimer; jmethodID m_getMSAASampleCount; WindowGlue() { - m_obj = NULL; - m_inval = NULL; - m_queueSkEvent = NULL; - m_startTimer = NULL; - m_getMSAASampleCount = NULL; + m_obj = nullptr; + m_inval = nullptr; + m_queueSkEvent = nullptr; + m_startTimer = nullptr; + m_getMSAASampleCount = nullptr; } } gWindowGlue; @@ -70,7 +70,7 @@ bool SkOSWindow::attach(SkBackEndTypes /* attachType */, int /*msaaSampleCount*/ if (!env || !gWindowGlue.m_getMSAASampleCount || !gWindowGlue.m_obj) { return false; } - if (env->IsSameObject(gWindowGlue.m_obj, NULL)) { + if (env->IsSameObject(gWindowGlue.m_obj, nullptr)) { SkDebugf("ERROR: The JNI WeakRef to the Window is invalid"); return false; } @@ -99,7 +99,7 @@ void SkOSWindow::onSetTitle(const char title[]) if (!env) { return; } - if (env->IsSameObject(gActivityGlue.m_obj, NULL)) { + if (env->IsSameObject(gActivityGlue.m_obj, nullptr)) { SkDebugf("ERROR: The JNI WeakRef to the Activity is invalid"); return; } @@ -115,7 +115,7 @@ void SkOSWindow::onHandleInval(const SkIRect& rect) if (!env || !gWindowGlue.m_inval || !gWindowGlue.m_obj) { return; } - if (env->IsSameObject(gWindowGlue.m_obj, NULL)) { + if (env->IsSameObject(gWindowGlue.m_obj, nullptr)) { SkDebugf("ERROR: The JNI WeakRef to the Window is invalid"); return; } @@ -129,7 +129,7 @@ void SkOSWindow::onPDFSaved(const char title[], const char desc[], if (!env || !gActivityGlue.m_addToDownloads || !gActivityGlue.m_obj) { return; } - if (env->IsSameObject(gActivityGlue.m_obj, NULL)) { + if (env->IsSameObject(gActivityGlue.m_obj, nullptr)) { SkDebugf("ERROR: The JNI WeakRef to the Activity is invalid"); return; } @@ -156,7 +156,7 @@ void SkEvent::SignalQueueTimer(SkMSec ms) if (!env || !gWindowGlue.m_startTimer || !gWindowGlue.m_obj || !ms) { return; } - if (env->IsSameObject(gWindowGlue.m_obj, NULL)) { + if (env->IsSameObject(gWindowGlue.m_obj, nullptr)) { SkDebugf("ERROR: The JNI WeakRef to the Window is invalid"); return; } @@ -170,7 +170,7 @@ void SkEvent::SignalNonEmptyQueue() if (!env || !gWindowGlue.m_queueSkEvent || !gWindowGlue.m_obj) { return; } - if (env->IsSameObject(gWindowGlue.m_obj, NULL)) { + if (env->IsSameObject(gWindowGlue.m_obj, nullptr)) { SkDebugf("ERROR: The JNI WeakRef to the Window is invalid"); return; } @@ -234,7 +234,7 @@ JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_init(JNIEnv* env, if (gWindow) { SkDebugf("The sample window already exists."); } else { - gWindow = new SampleWindow(NULL, args.count(), const_cast<char**>(args.begin()), NULL); + gWindow = new SampleWindow(nullptr, args.count(), const_cast<char**>(args.begin()), nullptr); } // cleanup the command line flags @@ -256,15 +256,15 @@ JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_term(JNIEnv* env, jobject thiz) { delete gWindow; - gWindow = NULL; + gWindow = nullptr; application_term(); if (gWindowGlue.m_obj) { env->DeleteWeakGlobalRef(gWindowGlue.m_obj); - gWindowGlue.m_obj = NULL; + gWindowGlue.m_obj = nullptr; } if (gActivityGlue.m_obj) { env->DeleteWeakGlobalRef(gActivityGlue.m_obj); - gActivityGlue.m_obj = NULL; + gActivityGlue.m_obj = nullptr; } } @@ -272,7 +272,7 @@ JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_draw( JNIEnv* env, jobject thiz) { if (!gWindow) return; - gWindow->update(NULL); + gWindow->update(nullptr); } JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_updateSize(JNIEnv* env, diff --git a/platform_tools/android/apps/visualbench/src/main/jni/SkOSWindow_AndroidNative.cpp b/platform_tools/android/apps/visualbench/src/main/jni/SkOSWindow_AndroidNative.cpp index e2bc99610f..487835b31d 100644 --- a/platform_tools/android/apps/visualbench/src/main/jni/SkOSWindow_AndroidNative.cpp +++ b/platform_tools/android/apps/visualbench/src/main/jni/SkOSWindow_AndroidNative.cpp @@ -111,8 +111,8 @@ bool SkOSWindow::attach(SkBackEndTypes attachType, ANativeWindow_setBuffersGeometry(fNativeWindow, 0, 0, format); - surface = eglCreateWindowSurface(display, config, fNativeWindow, NULL); - context = eglCreateContext(display, config, NULL, kAPIs[api].fContextAttribs); + surface = eglCreateWindowSurface(display, config, fNativeWindow, nullptr); + context = eglCreateContext(display, config, nullptr, kAPIs[api].fContextAttribs); if (EGL_NO_CONTEXT == context) { SkDebugf("eglCreateContext failed. EGL Error: 0x%08x\n", eglGetError()); continue; diff --git a/platform_tools/android/apps/visualbench/src/main/jni/main.cpp b/platform_tools/android/apps/visualbench/src/main/jni/main.cpp index ba78c3f280..f8d54cd064 100644 --- a/platform_tools/android/apps/visualbench/src/main/jni/main.cpp +++ b/platform_tools/android/apps/visualbench/src/main/jni/main.cpp @@ -22,7 +22,7 @@ enum State { }; struct VisualBenchState { - VisualBenchState() : fApp(NULL), fWindow(NULL), fState(kInit_State) {} + VisualBenchState() : fApp(nullptr), fWindow(nullptr), fState(kInit_State) {} struct android_app* fApp; SkOSWindow* fWindow; SkTArray<SkString> fFlags; @@ -34,7 +34,7 @@ static void handle_cmd(struct android_app* app, int32_t cmd) { switch (cmd) { case APP_CMD_INIT_WINDOW: // The window is being shown, get it ready. - if (state->fApp->window != NULL && kInit_State == state->fState) { + if (state->fApp->window != nullptr && kInit_State == state->fState) { // drain any events that occurred before |window| was assigned. while (SkEvent::ProcessEvent()); @@ -102,9 +102,9 @@ void android_main(struct android_app* state) { struct android_poll_source* source; // We loop until all events are read, then continue to draw the next frame of animation. - while ((ident=ALooper_pollAll(0, NULL, &events, (void**)&source)) >= 0) { + while ((ident=ALooper_pollAll(0, nullptr, &events, (void**)&source)) >= 0) { // Process this event. - if (source != NULL) { + if (source != nullptr) { source->process(state, source); } @@ -119,13 +119,13 @@ void android_main(struct android_app* state) { if (visualBenchState.fWindow->destroyRequested()) { visualBenchState.fState = kDestroyRequested_State; } else { - visualBenchState.fWindow->update(NULL); + visualBenchState.fWindow->update(nullptr); } } if (kDestroyRequested_State == visualBenchState.fState) { delete visualBenchState.fWindow; - visualBenchState.fWindow = NULL; + visualBenchState.fWindow = nullptr; application_term(); ANativeActivity_finish(state->activity); visualBenchState.fState = kFinished_State; |