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

Side by Side Diff: media/remoting/interstitial.cc

Issue 2823003002: SkBitmap and SkPixelRef no longer need lock/unlock (Closed)
Patch Set: rebase Created 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "media/remoting/interstitial.h" 5 #include "media/remoting/interstitial.h"
6 6
7 #include <algorithm> // for std::max() 7 #include <algorithm> // for std::max()
8 8
9 #include "media/base/localized_strings.h" 9 #include "media/base/localized_strings.h"
10 #include "media/base/video_frame.h" 10 #include "media/base/video_frame.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 canvas.writePixels(processed_image, centered_rect.x(), centered_rect.y()); 145 canvas.writePixels(processed_image, centered_rect.x(), centered_rect.y());
146 } 146 }
147 147
148 RenderCastMessage(canvas_size, type, &canvas); 148 RenderCastMessage(canvas_size, type, &canvas);
149 149
150 // Create a new VideoFrame, copy the bitmap, then return it. 150 // Create a new VideoFrame, copy the bitmap, then return it.
151 scoped_refptr<VideoFrame> video_frame = VideoFrame::CreateFrame( 151 scoped_refptr<VideoFrame> video_frame = VideoFrame::CreateFrame(
152 PIXEL_FORMAT_I420, canvas_size, gfx::Rect(canvas_size), canvas_size, 152 PIXEL_FORMAT_I420, canvas_size, gfx::Rect(canvas_size), canvas_size,
153 base::TimeDelta()); 153 base::TimeDelta());
154 if (video_frame) { 154 if (video_frame) {
155 SkAutoLockPixels pixel_lock(canvas_bitmap);
156 CopyRGBToVideoFrame(reinterpret_cast<uint8_t*>(canvas_bitmap.getPixels()), 155 CopyRGBToVideoFrame(reinterpret_cast<uint8_t*>(canvas_bitmap.getPixels()),
157 canvas_bitmap.rowBytes(), 156 canvas_bitmap.rowBytes(),
158 gfx::Rect(canvas_size.width(), canvas_size.height()), 157 gfx::Rect(canvas_size.width(), canvas_size.height()),
159 video_frame.get()); 158 video_frame.get());
160 } 159 }
161 return video_frame; 160 return video_frame;
162 } 161 }
163 162
164 } // namespace remoting 163 } // namespace remoting
165 } // namespace media 164 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698