| OLD | NEW |
| 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 const LayerSettings& settings) { | 14 return make_scoped_refptr(new IOSurfaceLayer()); |
| 15 return make_scoped_refptr(new IOSurfaceLayer(settings)); | |
| 16 } | 15 } |
| 17 | 16 |
| 18 IOSurfaceLayer::IOSurfaceLayer(const LayerSettings& settings) | 17 IOSurfaceLayer::IOSurfaceLayer() : io_surface_id_(0) {} |
| 19 : Layer(settings), io_surface_id_(0) { | |
| 20 } | |
| 21 | 18 |
| 22 IOSurfaceLayer::~IOSurfaceLayer() {} | 19 IOSurfaceLayer::~IOSurfaceLayer() {} |
| 23 | 20 |
| 24 void IOSurfaceLayer::SetIOSurfaceProperties(uint32_t io_surface_id, | 21 void IOSurfaceLayer::SetIOSurfaceProperties(uint32_t io_surface_id, |
| 25 const gfx::Size& size) { | 22 const gfx::Size& size) { |
| 26 io_surface_id_ = io_surface_id; | 23 io_surface_id_ = io_surface_id; |
| 27 io_surface_size_ = size; | 24 io_surface_size_ = size; |
| 28 UpdateDrawsContent(HasDrawableContent()); | 25 UpdateDrawsContent(HasDrawableContent()); |
| 29 SetNeedsCommit(); | 26 SetNeedsCommit(); |
| 30 } | 27 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 47 } | 44 } |
| 48 | 45 |
| 49 bool IOSurfaceLayer::Update() { | 46 bool IOSurfaceLayer::Update() { |
| 50 bool updated = Layer::Update(); | 47 bool updated = Layer::Update(); |
| 51 // 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, |
| 52 // 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. |
| 53 return updated || !update_rect_.IsEmpty(); | 50 return updated || !update_rect_.IsEmpty(); |
| 54 } | 51 } |
| 55 | 52 |
| 56 } // namespace cc | 53 } // namespace cc |
| OLD | NEW |