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

Side by Side Diff: cc/layers/io_surface_layer.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 unified diff | Download patch
« no previous file with comments | « cc/layers/io_surface_layer.h ('k') | cc/layers/io_surface_layer_impl.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "cc/layers/io_surface_layer.h" 5 #include "cc/layers/io_surface_layer.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "cc/layers/io_surface_layer_impl.h" 9 #include "cc/layers/io_surface_layer_impl.h"
10 10
11 namespace cc { 11 namespace cc {
12 12
13 scoped_refptr<IOSurfaceLayer> IOSurfaceLayer::Create() { 13 scoped_refptr<IOSurfaceLayer> IOSurfaceLayer::Create() {
14 return make_scoped_refptr(new IOSurfaceLayer()); 14 return make_scoped_refptr(new IOSurfaceLayer());
15 } 15 }
16 16
17 IOSurfaceLayer::IOSurfaceLayer() : io_surface_id_(0) {} 17 IOSurfaceLayer::IOSurfaceLayer() : io_surface_id_(0) {}
18 18
19 IOSurfaceLayer::~IOSurfaceLayer() {} 19 IOSurfaceLayer::~IOSurfaceLayer() {}
20 20
21 void IOSurfaceLayer::SetIOSurfaceProperties(uint32_t io_surface_id, 21 void IOSurfaceLayer::SetIOSurfaceProperties(uint32_t io_surface_id,
22 const gfx::Size& size) { 22 const gfx::Size& size) {
23 io_surface_id_ = io_surface_id; 23 io_surface_id_ = io_surface_id;
24 io_surface_size_ = size; 24 io_surface_size_ = size;
25 UpdateDrawsContent(HasDrawableContent()); 25 UpdateDrawsContent(HasDrawableContent());
26 SetNeedsCommit(); 26 SetNeedsCommit();
27 } 27 }
28 28
29 scoped_ptr<LayerImpl> IOSurfaceLayer::CreateLayerImpl( 29 std::unique_ptr<LayerImpl> IOSurfaceLayer::CreateLayerImpl(
30 LayerTreeImpl* tree_impl) { 30 LayerTreeImpl* tree_impl) {
31 return IOSurfaceLayerImpl::Create(tree_impl, layer_id_); 31 return IOSurfaceLayerImpl::Create(tree_impl, layer_id_);
32 } 32 }
33 33
34 bool IOSurfaceLayer::HasDrawableContent() const { 34 bool IOSurfaceLayer::HasDrawableContent() const {
35 return io_surface_id_ && Layer::HasDrawableContent(); 35 return io_surface_id_ && Layer::HasDrawableContent();
36 } 36 }
37 37
38 void IOSurfaceLayer::PushPropertiesTo(LayerImpl* layer) { 38 void IOSurfaceLayer::PushPropertiesTo(LayerImpl* layer) {
39 Layer::PushPropertiesTo(layer); 39 Layer::PushPropertiesTo(layer);
40 40
41 IOSurfaceLayerImpl* io_surface_layer = 41 IOSurfaceLayerImpl* io_surface_layer =
42 static_cast<IOSurfaceLayerImpl*>(layer); 42 static_cast<IOSurfaceLayerImpl*>(layer);
43 io_surface_layer->SetIOSurfaceProperties(io_surface_id_, io_surface_size_); 43 io_surface_layer->SetIOSurfaceProperties(io_surface_id_, io_surface_size_);
44 } 44 }
45 45
46 bool IOSurfaceLayer::Update() { 46 bool IOSurfaceLayer::Update() {
47 bool updated = Layer::Update(); 47 bool updated = Layer::Update();
48 // This layer doesn't update any resources from the main thread side, 48 // This layer doesn't update any resources from the main thread side,
49 // but repaint rects need to be sent to the layer impl via commit. 49 // but repaint rects need to be sent to the layer impl via commit.
50 return updated || !update_rect_.IsEmpty(); 50 return updated || !update_rect_.IsEmpty();
51 } 51 }
52 52
53 } // namespace cc 53 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/io_surface_layer.h ('k') | cc/layers/io_surface_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698