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

Side by Side Diff: printing/emf_win.cc

Issue 9720040: ui/gfx: Do not use the deprecated SkBitmap::getConfig() function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | « no previous file | skia/ext/vector_platform_device_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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "printing/emf_win.h" 5 #include "printing/emf_win.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "skia/ext/vector_platform_device_emf_win.h" 10 #include "skia/ext/vector_platform_device_emf_win.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 bmih->biSizeImage)) { 284 bmih->biSizeImage)) {
285 play_normally = false; 285 play_normally = false;
286 bitmap.reset(new SkBitmap()); 286 bitmap.reset(new SkBitmap());
287 gfx::PNGCodec::Decode(bits, bmih->biSizeImage, bitmap.get()); 287 gfx::PNGCodec::Decode(bits, bmih->biSizeImage, bitmap.get());
288 } 288 }
289 } 289 }
290 if (!play_normally) { 290 if (!play_normally) {
291 DCHECK(bitmap.get()); 291 DCHECK(bitmap.get());
292 if (bitmap.get()) { 292 if (bitmap.get()) {
293 SkAutoLockPixels lock(*bitmap.get()); 293 SkAutoLockPixels lock(*bitmap.get());
294 DCHECK_EQ(bitmap->getConfig(), SkBitmap::kARGB_8888_Config); 294 DCHECK_EQ(bitmap->config(), SkBitmap::kARGB_8888_Config);
295 const uint32_t* pixels = 295 const uint32_t* pixels =
296 static_cast<const uint32_t*>(bitmap->getPixels()); 296 static_cast<const uint32_t*>(bitmap->getPixels());
297 if (pixels == NULL) { 297 if (pixels == NULL) {
298 NOTREACHED(); 298 NOTREACHED();
299 return false; 299 return false;
300 } 300 }
301 BITMAPINFOHEADER bmi = {0}; 301 BITMAPINFOHEADER bmi = {0};
302 gfx::CreateBitmapHeader(bitmap->width(), bitmap->height(), &bmi); 302 gfx::CreateBitmapHeader(bitmap->width(), bitmap->height(), &bmi);
303 res = (0 != StretchDIBits(hdc, sdib_record->xDest, sdib_record->yDest, 303 res = (0 != StretchDIBits(hdc, sdib_record->xDest, sdib_record->yDest,
304 sdib_record->cxDest, 304 sdib_record->cxDest,
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 } else { 465 } else {
466 DCHECK_EQ(emf.context_.handle_table, handle_table); 466 DCHECK_EQ(emf.context_.handle_table, handle_table);
467 DCHECK_EQ(emf.context_.objects_count, objects_count); 467 DCHECK_EQ(emf.context_.objects_count, objects_count);
468 DCHECK_EQ(emf.context_.hdc, hdc); 468 DCHECK_EQ(emf.context_.hdc, hdc);
469 } 469 }
470 emf.items_.push_back(Record(&emf.context_, record)); 470 emf.items_.push_back(Record(&emf.context_, record));
471 return 1; 471 return 1;
472 } 472 }
473 473
474 } // namespace printing 474 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | skia/ext/vector_platform_device_emf_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698