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

Side by Side Diff: cc/test/fake_recording_source.h

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 unified diff | Download patch
« no previous file with comments | « cc/test/fake_proxy.h ('k') | cc/test/fake_resource_provider.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef CC_TEST_FAKE_RECORDING_SOURCE_H_ 5 #ifndef CC_TEST_FAKE_RECORDING_SOURCE_H_
6 #define CC_TEST_FAKE_RECORDING_SOURCE_H_ 6 #define CC_TEST_FAKE_RECORDING_SOURCE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "cc/base/region.h" 10 #include "cc/base/region.h"
11 #include "cc/playback/recording_source.h" 11 #include "cc/playback/recording_source.h"
12 #include "cc/test/fake_content_layer_client.h" 12 #include "cc/test/fake_content_layer_client.h"
13 #include "cc/trees/layer_tree_settings.h" 13 #include "cc/trees/layer_tree_settings.h"
14 14
15 namespace base { 15 namespace base {
16 class WaitableEvent; 16 class WaitableEvent;
17 } // namespace base 17 } // namespace base
18 18
19 namespace cc { 19 namespace cc {
20 20
21 // This class provides method for test to add bitmap and draw rect to content 21 // This class provides method for test to add bitmap and draw rect to content
22 // layer client. This class also provides function to rerecord to generate a new 22 // layer client. This class also provides function to rerecord to generate a new
23 // display list. 23 // display list.
24 class FakeRecordingSource : public RecordingSource { 24 class FakeRecordingSource : public RecordingSource {
25 public: 25 public:
26 FakeRecordingSource(); 26 FakeRecordingSource();
27 ~FakeRecordingSource() override {} 27 ~FakeRecordingSource() override {}
28 28
29 static scoped_ptr<FakeRecordingSource> CreateRecordingSource( 29 static std::unique_ptr<FakeRecordingSource> CreateRecordingSource(
30 const gfx::Rect& recorded_viewport, 30 const gfx::Rect& recorded_viewport,
31 const gfx::Size& layer_bounds) { 31 const gfx::Size& layer_bounds) {
32 scoped_ptr<FakeRecordingSource> recording_source(new FakeRecordingSource); 32 std::unique_ptr<FakeRecordingSource> recording_source(
33 new FakeRecordingSource);
33 recording_source->SetRecordedViewport(recorded_viewport); 34 recording_source->SetRecordedViewport(recorded_viewport);
34 recording_source->SetLayerBounds(layer_bounds); 35 recording_source->SetLayerBounds(layer_bounds);
35 return recording_source; 36 return recording_source;
36 } 37 }
37 38
38 static scoped_ptr<FakeRecordingSource> CreateFilledRecordingSource( 39 static std::unique_ptr<FakeRecordingSource> CreateFilledRecordingSource(
39 const gfx::Size& layer_bounds) { 40 const gfx::Size& layer_bounds) {
40 scoped_ptr<FakeRecordingSource> recording_source(new FakeRecordingSource); 41 std::unique_ptr<FakeRecordingSource> recording_source(
42 new FakeRecordingSource);
41 recording_source->SetRecordedViewport(gfx::Rect(layer_bounds)); 43 recording_source->SetRecordedViewport(gfx::Rect(layer_bounds));
42 recording_source->SetLayerBounds(layer_bounds); 44 recording_source->SetLayerBounds(layer_bounds);
43 return recording_source; 45 return recording_source;
44 } 46 }
45 47
46 // RecordingSource overrides. 48 // RecordingSource overrides.
47 scoped_refptr<RasterSource> CreateRasterSource( 49 scoped_refptr<RasterSource> CreateRasterSource(
48 bool can_use_lcd) const override; 50 bool can_use_lcd) const override;
49 bool IsSuitableForGpuRasterization() const override; 51 bool IsSuitableForGpuRasterization() const override;
50 52
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 private: 134 private:
133 FakeContentLayerClient client_; 135 FakeContentLayerClient client_;
134 SkPaint default_paint_; 136 SkPaint default_paint_;
135 bool force_unsuitable_for_gpu_rasterization_; 137 bool force_unsuitable_for_gpu_rasterization_;
136 base::WaitableEvent* playback_allowed_event_; 138 base::WaitableEvent* playback_allowed_event_;
137 }; 139 };
138 140
139 } // namespace cc 141 } // namespace cc
140 142
141 #endif // CC_TEST_FAKE_RECORDING_SOURCE_H_ 143 #endif // CC_TEST_FAKE_RECORDING_SOURCE_H_
OLDNEW
« no previous file with comments | « cc/test/fake_proxy.h ('k') | cc/test/fake_resource_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698