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

Side by Side Diff: cc/layers/io_surface_layer.cc

Issue 1122393003: CC: Plumb LayerSettings parameter for cc::Layer construction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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
« no previous file with comments | « cc/layers/io_surface_layer.h ('k') | cc/layers/layer.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 "cc/layers/io_surface_layer_impl.h" 7 #include "cc/layers/io_surface_layer_impl.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
11 scoped_refptr<IOSurfaceLayer> IOSurfaceLayer::Create() { 11 scoped_refptr<IOSurfaceLayer> IOSurfaceLayer::Create(
12 return make_scoped_refptr(new IOSurfaceLayer()); 12 const LayerSettings& settings) {
13 return make_scoped_refptr(new IOSurfaceLayer(settings));
13 } 14 }
14 15
15 IOSurfaceLayer::IOSurfaceLayer() : Layer(), io_surface_id_(0) {} 16 IOSurfaceLayer::IOSurfaceLayer(const LayerSettings& settings)
17 : Layer(settings), io_surface_id_(0) {
18 }
16 19
17 IOSurfaceLayer::~IOSurfaceLayer() {} 20 IOSurfaceLayer::~IOSurfaceLayer() {}
18 21
19 void IOSurfaceLayer::SetIOSurfaceProperties(uint32_t io_surface_id, 22 void IOSurfaceLayer::SetIOSurfaceProperties(uint32_t io_surface_id,
20 const gfx::Size& size) { 23 const gfx::Size& size) {
21 io_surface_id_ = io_surface_id; 24 io_surface_id_ = io_surface_id;
22 io_surface_size_ = size; 25 io_surface_size_ = size;
23 UpdateDrawsContent(HasDrawableContent()); 26 UpdateDrawsContent(HasDrawableContent());
24 SetNeedsCommit(); 27 SetNeedsCommit();
25 } 28 }
(...skipping 18 matching lines...) Expand all
44 bool IOSurfaceLayer::Update(ResourceUpdateQueue* queue, 47 bool IOSurfaceLayer::Update(ResourceUpdateQueue* queue,
45 const OcclusionTracker<Layer>* occlusion) { 48 const OcclusionTracker<Layer>* occlusion) {
46 bool updated = Layer::Update(queue, occlusion); 49 bool updated = Layer::Update(queue, occlusion);
47 50
48 // This layer doesn't update any resources from the main thread side, 51 // 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. 52 // but repaint rects need to be sent to the layer impl via commit.
50 return updated || !update_rect_.IsEmpty(); 53 return updated || !update_rect_.IsEmpty();
51 } 54 }
52 55
53 } // namespace cc 56 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/io_surface_layer.h ('k') | cc/layers/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698