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

Side by Side Diff: content/renderer/webclipboard_impl.cc

Issue 382623002: SkBitmap::Config is no more, use SkColorType (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: missed some for chromeos and win Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « content/common/common_param_traits_unittest.cc ('k') | printing/emf_win.cc » ('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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/renderer/webclipboard_impl.h" 5 #include "content/renderer/webclipboard_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/pickle.h" 8 #include "base/pickle.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 } 149 }
150 150
151 void WebClipboardImpl::writeImage(const WebImage& image, 151 void WebClipboardImpl::writeImage(const WebImage& image,
152 const WebURL& url, 152 const WebURL& url,
153 const WebString& title) { 153 const WebString& title) {
154 ScopedClipboardWriterGlue scw(client_); 154 ScopedClipboardWriterGlue scw(client_);
155 155
156 if (!image.isNull()) { 156 if (!image.isNull()) {
157 const SkBitmap& bitmap = image.getSkBitmap(); 157 const SkBitmap& bitmap = image.getSkBitmap();
158 // WriteBitmapFromPixels expects 32-bit data. 158 // WriteBitmapFromPixels expects 32-bit data.
159 DCHECK_EQ(bitmap.config(), SkBitmap::kARGB_8888_Config); 159 DCHECK_EQ(bitmap.colorType(), kN32_SkColorType);
160 160
161 SkAutoLockPixels locked(bitmap); 161 SkAutoLockPixels locked(bitmap);
162 void *pixels = bitmap.getPixels(); 162 void *pixels = bitmap.getPixels();
163 // TODO(piman): this should not be NULL, but it is. crbug.com/369621 163 // TODO(piman): this should not be NULL, but it is. crbug.com/369621
164 if (!pixels) 164 if (!pixels)
165 return; 165 return;
166 scw.WriteBitmapFromPixels(pixels, image.size()); 166 scw.WriteBitmapFromPixels(pixels, image.size());
167 } 167 }
168 168
169 if (!url.isEmpty()) { 169 if (!url.isEmpty()) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 return false; 220 return false;
221 #endif 221 #endif
222 default: 222 default:
223 NOTREACHED(); 223 NOTREACHED();
224 return false; 224 return false;
225 } 225 }
226 return true; 226 return true;
227 } 227 }
228 228
229 } // namespace content 229 } // namespace content
OLDNEW
« no previous file with comments | « content/common/common_param_traits_unittest.cc ('k') | printing/emf_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698