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

Unified Diff: ui/gl/gl_image_memory.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_image_glx.cc ('k') | ui/gl/gl_image_shared_memory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_memory.cc
diff --git a/ui/gl/gl_image_memory.cc b/ui/gl/gl_image_memory.cc
index a29a388585fcd41406455446d0156f27deb0075d..2bb63c36174cf3519244d16db268ab64ac8ede80 100644
--- a/ui/gl/gl_image_memory.cc
+++ b/ui/gl/gl_image_memory.cc
@@ -200,21 +200,21 @@ GLint DataRowLength(size_t stride, BufferFormat format) {
}
template <typename F>
-scoped_ptr<uint8_t[]> GLES2RGBData(const gfx::Size& size,
- BufferFormat format,
- size_t stride,
- const uint8_t* data,
- F const& data_to_rgb,
- GLenum* data_format,
- GLenum* data_type,
- GLint* data_row_length) {
+std::unique_ptr<uint8_t[]> GLES2RGBData(const gfx::Size& size,
+ BufferFormat format,
+ size_t stride,
+ const uint8_t* data,
+ F const& data_to_rgb,
+ GLenum* data_format,
+ GLenum* data_type,
+ GLint* data_row_length) {
TRACE_EVENT2("gpu", "GLES2RGBData", "width", size.width(), "height",
size.height());
// Four-byte row alignment as specified by glPixelStorei with argument
// GL_UNPACK_ALIGNMENT set to 4.
size_t gles2_rgb_data_stride = (size.width() * 3 + 3) & ~3;
- scoped_ptr<uint8_t[]> gles2_rgb_data(
+ std::unique_ptr<uint8_t[]> gles2_rgb_data(
new uint8_t[gles2_rgb_data_stride * size.height()]);
for (int y = 0; y < size.height(); ++y) {
@@ -230,13 +230,13 @@ scoped_ptr<uint8_t[]> GLES2RGBData(const gfx::Size& size,
return gles2_rgb_data;
}
-scoped_ptr<uint8_t[]> GLES2Data(const gfx::Size& size,
- BufferFormat format,
- size_t stride,
- const uint8_t* data,
- GLenum* data_format,
- GLenum* data_type,
- GLint* data_row_length) {
+std::unique_ptr<uint8_t[]> GLES2Data(const gfx::Size& size,
+ BufferFormat format,
+ size_t stride,
+ const uint8_t* data,
+ GLenum* data_format,
+ GLenum* data_type,
+ GLint* data_row_length) {
TRACE_EVENT2("gpu", "GLES2Data", "width", size.width(), "height",
size.height());
@@ -265,7 +265,7 @@ scoped_ptr<uint8_t[]> GLES2Data(const gfx::Size& size,
gfx::g_driver_gl.ext.b_GL_EXT_unpack_subimage)
return nullptr; // No data conversion needed
- scoped_ptr<uint8_t[]> gles2_data(
+ std::unique_ptr<uint8_t[]> gles2_data(
new uint8_t[gles2_data_stride * size.height()]);
for (int y = 0; y < size.height(); ++y) {
memcpy(&gles2_data[y * gles2_data_stride], &data[y * stride],
@@ -365,7 +365,7 @@ bool GLImageMemory::CopyTexImage(unsigned target) {
GLenum data_format = DataFormat(format_);
GLenum data_type = DataType(format_);
GLint data_row_length = DataRowLength(stride_, format_);
- scoped_ptr<uint8_t[]> gles2_data;
+ std::unique_ptr<uint8_t[]> gles2_data;
if (gfx::GLContext::GetCurrent()->GetVersionInfo()->is_es) {
gles2_data = GLES2Data(size_, format_, stride_, memory_, &data_format,
@@ -415,7 +415,7 @@ bool GLImageMemory::CopyTexSubImage(unsigned target,
GLenum data_format = DataFormat(format_);
GLenum data_type = DataType(format_);
GLint data_row_length = DataRowLength(stride_, format_);
- scoped_ptr<uint8_t[]> gles2_data;
+ std::unique_ptr<uint8_t[]> gles2_data;
if (gfx::GLContext::GetCurrent()->GetVersionInfo()->is_es) {
gles2_data = GLES2Data(rect.size(), format_, stride_, data, &data_format,
« no previous file with comments | « ui/gl/gl_image_glx.cc ('k') | ui/gl/gl_image_shared_memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698