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

Side by Side Diff: content/browser/compositor/software_output_device_mac.mm

Issue 1855273002: Update new Surface callsites (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: software_output_device was indirectly including skia::refptr, switch to sk_sp<> 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
OLDNEW
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 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 if (io_result) { 116 if (io_result) {
117 DLOG(ERROR) << "Failed to lock IOSurface " << io_result; 117 DLOG(ERROR) << "Failed to lock IOSurface " << io_result;
118 return nullptr; 118 return nullptr;
119 } 119 }
120 } 120 }
121 121
122 SkPMColor* pixels = static_cast<SkPMColor*>( 122 SkPMColor* pixels = static_cast<SkPMColor*>(
123 IOSurfaceGetBaseAddress(io_surfaces_[current_index_])); 123 IOSurfaceGetBaseAddress(io_surfaces_[current_index_]));
124 size_t stride = IOSurfaceGetBytesPerRow(io_surfaces_[current_index_]); 124 size_t stride = IOSurfaceGetBytesPerRow(io_surfaces_[current_index_]);
125 125
126 canvas_ = skia::AdoptRef(SkCanvas::NewRasterDirectN32( 126 canvas_ = sk_sp<SkCanvas>(SkCanvas::NewRasterDirectN32(
127 pixel_size_.width(), pixel_size_.height(), pixels, stride)); 127 pixel_size_.width(), pixel_size_.height(), pixels, stride));
128 128
129 CopyPreviousBufferDamage(SkRegion(gfx::RectToSkIRect(new_damage_rect))); 129 CopyPreviousBufferDamage(SkRegion(gfx::RectToSkIRect(new_damage_rect)));
130 130
131 return canvas_.get(); 131 return canvas_.get();
132 } 132 }
133 133
134 void SoftwareOutputDeviceMac::EndPaint() { 134 void SoftwareOutputDeviceMac::EndPaint() {
135 SoftwareOutputDevice::EndPaint(); 135 SoftwareOutputDevice::EndPaint();
136 { 136 {
(...skipping 26 matching lines...) Expand all
163 gfx::VSyncProvider* SoftwareOutputDeviceMac::GetVSyncProvider() { 163 gfx::VSyncProvider* SoftwareOutputDeviceMac::GetVSyncProvider() {
164 return this; 164 return this;
165 } 165 }
166 166
167 void SoftwareOutputDeviceMac::GetVSyncParameters( 167 void SoftwareOutputDeviceMac::GetVSyncParameters(
168 const gfx::VSyncProvider::UpdateVSyncCallback& callback) { 168 const gfx::VSyncProvider::UpdateVSyncCallback& callback) {
169 update_vsync_callback_ = callback; 169 update_vsync_callback_ = callback;
170 } 170 }
171 171
172 } // namespace content 172 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/compositor/software_output_device_mac.h ('k') | content/browser/compositor/software_output_device_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698