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

Unified Diff: webrtc/test/linux/glx_renderer.cc

Issue 2685783014: Replace NULL with nullptr in all C++ files. (Closed)
Patch Set: Fixing android. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/test/linux/glx_renderer.cc
diff --git a/webrtc/test/linux/glx_renderer.cc b/webrtc/test/linux/glx_renderer.cc
index d6979c8a58f2b9c7308b92c0e50cec0f8502e87e..b5833c4bc308df320dce9a8df2165228fc891fef 100644
--- a/webrtc/test/linux/glx_renderer.cc
+++ b/webrtc/test/linux/glx_renderer.cc
@@ -22,10 +22,7 @@ namespace webrtc {
namespace test {
GlxRenderer::GlxRenderer(size_t width, size_t height)
- : width_(width),
- height_(height),
- display_(NULL),
- context_(NULL) {
+ : width_(width), height_(height), display_(nullptr), context_(nullptr) {
assert(width > 0);
assert(height > 0);
}
@@ -33,7 +30,7 @@ GlxRenderer::GlxRenderer(size_t width, size_t height)
GlxRenderer::~GlxRenderer() { Destroy(); }
bool GlxRenderer::Init(const char* window_title) {
- if ((display_ = XOpenDisplay(NULL)) == NULL) {
+ if ((display_ = XOpenDisplay(nullptr)) == nullptr) {
Destroy();
return false;
}
@@ -45,13 +42,13 @@ bool GlxRenderer::Init(const char* window_title) {
GLX_GREEN_SIZE, 4, GLX_BLUE_SIZE, 4, GLX_DEPTH_SIZE, 16,
None, };
- if ((vi = glXChooseVisual(display_, screen, attr_list)) == NULL) {
+ if ((vi = glXChooseVisual(display_, screen, attr_list)) == nullptr) {
Destroy();
return false;
}
context_ = glXCreateContext(display_, vi, 0, true);
- if (context_ == NULL) {
+ if (context_ == nullptr) {
Destroy();
return false;
}
@@ -68,7 +65,7 @@ bool GlxRenderer::Init(const char* window_title) {
XFree(vi);
XSetStandardProperties(display_, window_, window_title, window_title, None,
- NULL, 0, NULL);
+ nullptr, 0, nullptr);
Atom wm_delete = XInternAtom(display_, "WM_DELETE_WINDOW", True);
if (wm_delete != None) {
@@ -82,7 +79,7 @@ bool GlxRenderer::Init(const char* window_title) {
return false;
}
GlRenderer::Init();
- if (!glXMakeCurrent(display_, None, NULL)) {
+ if (!glXMakeCurrent(display_, None, nullptr)) {
Destroy();
return false;
}
@@ -92,17 +89,17 @@ bool GlxRenderer::Init(const char* window_title) {
}
void GlxRenderer::Destroy() {
- if (context_ != NULL) {
+ if (context_ != nullptr) {
glXMakeCurrent(display_, window_, context_);
GlRenderer::Destroy();
- glXMakeCurrent(display_, None, NULL);
+ glXMakeCurrent(display_, None, nullptr);
glXDestroyContext(display_, context_);
- context_ = NULL;
+ context_ = nullptr;
}
- if (display_ != NULL) {
+ if (display_ != nullptr) {
XCloseDisplay(display_);
- display_ = NULL;
+ display_ = nullptr;
}
}
@@ -112,7 +109,7 @@ GlxRenderer* GlxRenderer::Create(const char* window_title, size_t width,
if (!glx_renderer->Init(window_title)) {
// TODO(pbos): Add GLX-failed warning here?
delete glx_renderer;
- return NULL;
+ return nullptr;
}
return glx_renderer;
}
@@ -124,12 +121,12 @@ void GlxRenderer::Resize(size_t width, size_t height) {
abort();
}
GlRenderer::ResizeViewport(width_, height_);
- if (!glXMakeCurrent(display_, None, NULL)) {
+ if (!glXMakeCurrent(display_, None, nullptr)) {
abort();
}
XSizeHints* size_hints = XAllocSizeHints();
- if (size_hints == NULL) {
+ if (size_hints == nullptr) {
abort();
}
size_hints->flags = PAspect;
@@ -170,7 +167,7 @@ void GlxRenderer::OnFrame(const webrtc::VideoFrame& frame) {
GlRenderer::OnFrame(frame);
glXSwapBuffers(display_, window_);
- if (!glXMakeCurrent(display_, None, NULL)) {
+ if (!glXMakeCurrent(display_, None, nullptr)) {
abort();
}
}

Powered by Google App Engine
This is Rietveld 408576698