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

Unified Diff: cc/test/layer_tree_pixel_test.cc

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase 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 | « cc/test/layer_tree_pixel_test.h ('k') | cc/test/layer_tree_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_tree_pixel_test.cc
diff --git a/cc/test/layer_tree_pixel_test.cc b/cc/test/layer_tree_pixel_test.cc
index db86e7584e940e9a36443c0f1aa284ac04e79285..aaf0b5a22fe8c26e7dbf9c3343fea7f989146268 100644
--- a/cc/test/layer_tree_pixel_test.cc
+++ b/cc/test/layer_tree_pixel_test.cc
@@ -8,6 +8,7 @@
#include <stdint.h>
#include "base/command_line.h"
+#include "base/memory/ptr_util.h"
#include "base/path_service.h"
#include "cc/base/switches.h"
#include "cc/layers/solid_color_layer.h"
@@ -38,17 +39,17 @@ LayerTreePixelTest::LayerTreePixelTest()
LayerTreePixelTest::~LayerTreePixelTest() {}
-scoped_ptr<OutputSurface> LayerTreePixelTest::CreateOutputSurface() {
+std::unique_ptr<OutputSurface> LayerTreePixelTest::CreateOutputSurface() {
gfx::Size surface_expansion_size(40, 60);
- scoped_ptr<PixelTestOutputSurface> output_surface;
+ std::unique_ptr<PixelTestOutputSurface> output_surface;
switch (test_type_) {
case PIXEL_TEST_SOFTWARE: {
- scoped_ptr<PixelTestSoftwareOutputDevice> software_output_device(
+ std::unique_ptr<PixelTestSoftwareOutputDevice> software_output_device(
new PixelTestSoftwareOutputDevice);
software_output_device->set_surface_expansion_size(
surface_expansion_size);
- output_surface = make_scoped_ptr(
+ output_surface = base::WrapUnique(
new PixelTestOutputSurface(std::move(software_output_device)));
break;
}
@@ -58,7 +59,7 @@ scoped_ptr<OutputSurface> LayerTreePixelTest::CreateOutputSurface() {
new TestInProcessContextProvider(nullptr));
scoped_refptr<TestInProcessContextProvider> worker(
new TestInProcessContextProvider(compositor.get()));
- output_surface = make_scoped_ptr(new PixelTestOutputSurface(
+ output_surface = base::WrapUnique(new PixelTestOutputSurface(
std::move(compositor), std::move(worker), flipped_output_surface));
break;
}
@@ -76,12 +77,14 @@ void LayerTreePixelTest::WillCommitCompleteOnThread(LayerTreeHostImpl* impl) {
renderer->SetEnlargePassTextureAmountForTesting(enlarge_texture_amount_);
}
-scoped_ptr<CopyOutputRequest> LayerTreePixelTest::CreateCopyOutputRequest() {
+std::unique_ptr<CopyOutputRequest>
+LayerTreePixelTest::CreateCopyOutputRequest() {
return CopyOutputRequest::CreateBitmapRequest(
base::Bind(&LayerTreePixelTest::ReadbackResult, base::Unretained(this)));
}
-void LayerTreePixelTest::ReadbackResult(scoped_ptr<CopyOutputResult> result) {
+void LayerTreePixelTest::ReadbackResult(
+ std::unique_ptr<CopyOutputResult> result) {
ASSERT_TRUE(result->HasBitmap());
result_bitmap_ = result->TakeBitmap();
EndTest();
@@ -206,14 +209,15 @@ void LayerTreePixelTest::SetupTree() {
LayerTreeTest::SetupTree();
}
-scoped_ptr<SkBitmap> LayerTreePixelTest::CopyTextureMailboxToBitmap(
+std::unique_ptr<SkBitmap> LayerTreePixelTest::CopyTextureMailboxToBitmap(
const gfx::Size& size,
const TextureMailbox& texture_mailbox) {
DCHECK(texture_mailbox.IsTexture());
if (!texture_mailbox.IsTexture())
return nullptr;
- scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext();
+ std::unique_ptr<gpu::GLInProcessContext> context =
+ CreateTestInProcessContext();
GLES2Interface* gl = context->GetImplementation();
if (texture_mailbox.sync_token().HasData())
@@ -237,7 +241,7 @@ scoped_ptr<SkBitmap> LayerTreePixelTest::CopyTextureMailboxToBitmap(
EXPECT_EQ(static_cast<unsigned>(GL_FRAMEBUFFER_COMPLETE),
gl->CheckFramebufferStatus(GL_FRAMEBUFFER));
- scoped_ptr<uint8_t[]> pixels(new uint8_t[size.GetArea() * 4]);
+ std::unique_ptr<uint8_t[]> pixels(new uint8_t[size.GetArea() * 4]);
gl->ReadPixels(0,
0,
size.width(),
@@ -249,7 +253,7 @@ scoped_ptr<SkBitmap> LayerTreePixelTest::CopyTextureMailboxToBitmap(
gl->DeleteFramebuffers(1, &fbo);
gl->DeleteTextures(1, &texture_id);
- scoped_ptr<SkBitmap> bitmap(new SkBitmap);
+ std::unique_ptr<SkBitmap> bitmap(new SkBitmap);
bitmap->allocN32Pixels(size.width(), size.height());
uint8_t* out_pixels = static_cast<uint8_t*>(bitmap->getPixels());
@@ -272,7 +276,8 @@ scoped_ptr<SkBitmap> LayerTreePixelTest::CopyTextureMailboxToBitmap(
}
void LayerTreePixelTest::Finish() {
- scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext();
+ std::unique_ptr<gpu::GLInProcessContext> context =
+ CreateTestInProcessContext();
GLES2Interface* gl = context->GetImplementation();
gl->Finish();
}
« no previous file with comments | « cc/test/layer_tree_pixel_test.h ('k') | cc/test/layer_tree_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698