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

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_device.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 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
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_device.h ('k') | ui/ozone/platform/drm/gpu/drm_device_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/ozone/platform/drm/gpu/drm_device.h" 5 #include "ui/ozone/platform/drm/gpu/drm_device.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <sys/mman.h> 8 #include <sys/mman.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 #include <xf86drm.h> 10 #include <xf86drm.h>
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 int DestroyPropertyBlob(int fd, uint32_t id) { 172 int DestroyPropertyBlob(int fd, uint32_t id) {
173 DrmModeDestroyBlob destroy; 173 DrmModeDestroyBlob destroy;
174 int ret; 174 int ret;
175 175
176 memset(&destroy, 0, sizeof(destroy)); 176 memset(&destroy, 0, sizeof(destroy));
177 destroy.blob_id = id; 177 destroy.blob_id = id;
178 ret = drmIoctl(fd, DRM_IOCTL_MODE_DESTROYPROPBLOB, &destroy); 178 ret = drmIoctl(fd, DRM_IOCTL_MODE_DESTROYPROPBLOB, &destroy);
179 return ret < 0 ? -errno : ret; 179 return ret < 0 ? -errno : ret;
180 } 180 }
181 181
182 using ScopedDrmColorLutPtr = scoped_ptr<DrmColorLut, base::FreeDeleter>; 182 using ScopedDrmColorLutPtr = std::unique_ptr<DrmColorLut, base::FreeDeleter>;
183 using ScopedDrmColorCtmPtr = scoped_ptr<DrmColorCtm, base::FreeDeleter>; 183 using ScopedDrmColorCtmPtr = std::unique_ptr<DrmColorCtm, base::FreeDeleter>;
184 184
185 ScopedDrmColorLutPtr CreateLutBlob( 185 ScopedDrmColorLutPtr CreateLutBlob(
186 const std::vector<GammaRampRGBEntry>& source) { 186 const std::vector<GammaRampRGBEntry>& source) {
187 TRACE_EVENT0("drm", "CreateLutBlob"); 187 TRACE_EVENT0("drm", "CreateLutBlob");
188 ScopedDrmColorLutPtr lut( 188 ScopedDrmColorLutPtr lut(
189 static_cast<DrmColorLut*>(malloc(sizeof(DrmColorLut) * source.size()))); 189 static_cast<DrmColorLut*>(malloc(sizeof(DrmColorLut) * source.size())));
190 DrmColorLut* p = lut.get(); 190 DrmColorLut* p = lut.get();
191 for (size_t i = 0; i < source.size(); ++i) { 191 for (size_t i = 0; i < source.size(); ++i) {
192 p[i].red = source[i].r; 192 p[i].red = source[i].r;
193 p[i].green = source[i].g; 193 p[i].green = source[i].g;
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 reinterpret_cast<unsigned char*>(ctm_blob_data.get()), 763 reinterpret_cast<unsigned char*>(ctm_blob_data.get()),
764 sizeof(DrmColorCtm))) 764 sizeof(DrmColorCtm)))
765 return false; 765 return false;
766 } 766 }
767 } 767 }
768 768
769 return true; 769 return true;
770 } 770 }
771 771
772 } // namespace ui 772 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_device.h ('k') | ui/ozone/platform/drm/gpu/drm_device_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698