| OLD | NEW |
| 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 "content/browser/compositor/software_output_device_mac.h" | 5 #include "content/browser/compositor/software_output_device_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
| 10 #include "third_party/skia/include/core/SkCanvas.h" | 10 #include "third_party/skia/include/core/SkCanvas.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 SoftwareOutputDevice::EndPaint(); | 133 SoftwareOutputDevice::EndPaint(); |
| 134 { | 134 { |
| 135 TRACE_EVENT0("browser", "IOSurfaceUnlock"); | 135 TRACE_EVENT0("browser", "IOSurfaceUnlock"); |
| 136 IOReturn io_result = IOSurfaceUnlock(io_surfaces_[current_index_], | 136 IOReturn io_result = IOSurfaceUnlock(io_surfaces_[current_index_], |
| 137 kIOSurfaceLockAvoidSync, nullptr); | 137 kIOSurfaceLockAvoidSync, nullptr); |
| 138 if (io_result) | 138 if (io_result) |
| 139 DLOG(ERROR) << "Failed to unlock IOSurface " << io_result; | 139 DLOG(ERROR) << "Failed to unlock IOSurface " << io_result; |
| 140 } | 140 } |
| 141 | 141 |
| 142 canvas_ = nullptr; | 142 canvas_ = nullptr; |
| 143 ui::AcceleratedWidgetMacGotIOSurfaceFrame(compositor_->widget(), | 143 ui::AcceleratedWidgetMacGotFrame(compositor_->widget(), 0, |
| 144 io_surfaces_[current_index_], | 144 io_surfaces_[current_index_], pixel_size_, |
| 145 pixel_size_, scale_factor_, false); | 145 scale_factor_, nullptr, nullptr); |
| 146 | 146 |
| 147 current_index_ = !current_index_; | 147 current_index_ = !current_index_; |
| 148 } | 148 } |
| 149 | 149 |
| 150 void SoftwareOutputDeviceMac::DiscardBackbuffer() { | 150 void SoftwareOutputDeviceMac::DiscardBackbuffer() { |
| 151 for (int i = 0; i < 2; ++i) | 151 for (int i = 0; i < 2; ++i) |
| 152 io_surfaces_[i].reset(); | 152 io_surfaces_[i].reset(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 void SoftwareOutputDeviceMac::EnsureBackbuffer() {} | 155 void SoftwareOutputDeviceMac::EnsureBackbuffer() {} |
| 156 | 156 |
| 157 } // namespace content | 157 } // namespace content |
| OLD | NEW |