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

Side by Side Diff: content/common/gpu/gpu_memory_buffer_factory_io_surface.cc

Issue 649533003: C++11 declares a type safe null pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Presubmit errors Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/gpu/gpu_memory_buffer_factory_io_surface.h" 5 #include "content/common/gpu/gpu_memory_buffer_factory_io_surface.h"
6 6
7 #include <CoreFoundation/CoreFoundation.h> 7 #include <CoreFoundation/CoreFoundation.h>
8 8
9 #include "content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h" 9 #include "content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h"
10 #include "ui/gl/gl_image_io_surface.h" 10 #include "ui/gl/gl_image_io_surface.h"
11 11
12 namespace content { 12 namespace content {
13 namespace { 13 namespace {
14 14
15 void AddBooleanValue(CFMutableDictionaryRef dictionary, 15 void AddBooleanValue(CFMutableDictionaryRef dictionary,
16 const CFStringRef key, 16 const CFStringRef key,
17 bool value) { 17 bool value) {
18 CFDictionaryAddValue( 18 CFDictionaryAddValue(
19 dictionary, key, value ? kCFBooleanTrue : kCFBooleanFalse); 19 dictionary, key, value ? kCFBooleanTrue : kCFBooleanFalse);
20 } 20 }
21 21
22 void AddIntegerValue(CFMutableDictionaryRef dictionary, 22 void AddIntegerValue(CFMutableDictionaryRef dictionary,
23 const CFStringRef key, 23 const CFStringRef key,
24 int32 value) { 24 int32 value) {
25 base::ScopedCFTypeRef<CFNumberRef> number( 25 base::ScopedCFTypeRef<CFNumberRef> number(
26 CFNumberCreate(NULL, kCFNumberSInt32Type, &value)); 26 CFNumberCreate(nullptr, kCFNumberSInt32Type, &value));
27 CFDictionaryAddValue(dictionary, key, number.get()); 27 CFDictionaryAddValue(dictionary, key, number.get());
28 } 28 }
29 29
30 } // namespace 30 } // namespace
31 31
32 GpuMemoryBufferFactoryIOSurface::GpuMemoryBufferFactoryIOSurface() { 32 GpuMemoryBufferFactoryIOSurface::GpuMemoryBufferFactoryIOSurface() {
33 } 33 }
34 34
35 GpuMemoryBufferFactoryIOSurface::~GpuMemoryBufferFactoryIOSurface() { 35 GpuMemoryBufferFactoryIOSurface::~GpuMemoryBufferFactoryIOSurface() {
36 } 36 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 return scoped_refptr<gfx::GLImage>(); 91 return scoped_refptr<gfx::GLImage>();
92 92
93 scoped_refptr<gfx::GLImageIOSurface> image(new gfx::GLImageIOSurface(size)); 93 scoped_refptr<gfx::GLImageIOSurface> image(new gfx::GLImageIOSurface(size));
94 if (!image->Initialize(it->second.get())) 94 if (!image->Initialize(it->second.get()))
95 return scoped_refptr<gfx::GLImage>(); 95 return scoped_refptr<gfx::GLImage>();
96 96
97 return image; 97 return image;
98 } 98 }
99 99
100 } // namespace content 100 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_memory_buffer_factory_android.cc ('k') | content/common/gpu/gpu_memory_buffer_factory_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698