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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp

Issue 1981823002: Remove OwnPtr::release() calls in platform/ (part 1). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 "platform/graphics/RecordingImageBufferSurface.h" 5 #include "platform/graphics/RecordingImageBufferSurface.h"
6 6
7 #include "platform/graphics/GraphicsContext.h" 7 #include "platform/graphics/GraphicsContext.h"
8 #include "platform/graphics/ImageBuffer.h" 8 #include "platform/graphics/ImageBuffer.h"
9 #include "platform/graphics/ImageBufferClient.h" 9 #include "platform/graphics/ImageBufferClient.h"
10 #include "platform/graphics/UnacceleratedImageBufferSurface.h" 10 #include "platform/graphics/UnacceleratedImageBufferSurface.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 private: 91 private:
92 int m_createSurfaceCount; 92 int m_createSurfaceCount;
93 }; 93 };
94 94
95 class RecordingImageBufferSurfaceTest : public Test { 95 class RecordingImageBufferSurfaceTest : public Test {
96 protected: 96 protected:
97 RecordingImageBufferSurfaceTest() 97 RecordingImageBufferSurfaceTest()
98 { 98 {
99 OwnPtr<MockSurfaceFactory> surfaceFactory = adoptPtr(new MockSurfaceFact ory()); 99 OwnPtr<MockSurfaceFactory> surfaceFactory = adoptPtr(new MockSurfaceFact ory());
100 m_surfaceFactory = surfaceFactory.get(); 100 m_surfaceFactory = surfaceFactory.get();
101 OwnPtr<RecordingImageBufferSurface> testSurface = adoptPtr(new Recording ImageBufferSurface(IntSize(10, 10), surfaceFactory.release())); 101 OwnPtr<RecordingImageBufferSurface> testSurface = adoptPtr(new Recording ImageBufferSurface(IntSize(10, 10), std::move(surfaceFactory)));
102 m_testSurface = testSurface.get(); 102 m_testSurface = testSurface.get();
103 // We create an ImageBuffer in order for the testSurface to be 103 // We create an ImageBuffer in order for the testSurface to be
104 // properly initialized with a GraphicsContext 104 // properly initialized with a GraphicsContext
105 m_imageBuffer = ImageBuffer::create(testSurface.release()); 105 m_imageBuffer = ImageBuffer::create(std::move(testSurface));
106 EXPECT_FALSE(!m_imageBuffer); 106 EXPECT_FALSE(!m_imageBuffer);
107 m_fakeImageBufferClient = adoptPtr(new FakeImageBufferClient(m_imageBuff er.get())); 107 m_fakeImageBufferClient = adoptPtr(new FakeImageBufferClient(m_imageBuff er.get()));
108 m_imageBuffer->setClient(m_fakeImageBufferClient.get()); 108 m_imageBuffer->setClient(m_fakeImageBufferClient.get());
109 } 109 }
110 110
111 public: 111 public:
112 void testEmptyPicture() 112 void testEmptyPicture()
113 { 113 {
114 m_testSurface->initializeCurrentFrame(); 114 m_testSurface->initializeCurrentFrame();
115 RefPtr<SkPicture> picture = m_testSurface->getPicture(); 115 RefPtr<SkPicture> picture = m_testSurface->getPicture();
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 expectDisplayListEnabled(true); 384 expectDisplayListEnabled(true);
385 } 385 }
386 386
387 TEST_F(RecordingImageBufferSurfaceTest, testClearRect) 387 TEST_F(RecordingImageBufferSurfaceTest, testClearRect)
388 { 388 {
389 CALL_TEST_TASK_WRAPPER(testClearRect); 389 CALL_TEST_TASK_WRAPPER(testClearRect);
390 expectDisplayListEnabled(true); 390 expectDisplayListEnabled(true);
391 } 391 }
392 392
393 } // namespace blink 393 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698