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

Side by Side Diff: printing/emf_win.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/renderer/webclipboard_impl.cc ('k') | skia/config/SkUserConfig.h » ('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/files/file_path.h" 7 #include "base/files/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 "base/win/scoped_gdi_object.h" 10 #include "base/win/scoped_gdi_object.h"
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 bmih->biSizeImage)) { 402 bmih->biSizeImage)) {
403 play_normally = false; 403 play_normally = false;
404 bitmap.reset(new SkBitmap()); 404 bitmap.reset(new SkBitmap());
405 gfx::PNGCodec::Decode(bits, bmih->biSizeImage, bitmap.get()); 405 gfx::PNGCodec::Decode(bits, bmih->biSizeImage, bitmap.get());
406 } 406 }
407 } 407 }
408 if (!play_normally) { 408 if (!play_normally) {
409 DCHECK(bitmap.get()); 409 DCHECK(bitmap.get());
410 if (bitmap.get()) { 410 if (bitmap.get()) {
411 SkAutoLockPixels lock(*bitmap.get()); 411 SkAutoLockPixels lock(*bitmap.get());
412 DCHECK_EQ(bitmap->config(), SkBitmap::kARGB_8888_Config); 412 DCHECK_EQ(bitmap->colorType(), kN32_SkColorType);
413 const uint32_t* pixels = 413 const uint32_t* pixels =
414 static_cast<const uint32_t*>(bitmap->getPixels()); 414 static_cast<const uint32_t*>(bitmap->getPixels());
415 if (pixels == NULL) { 415 if (pixels == NULL) {
416 NOTREACHED(); 416 NOTREACHED();
417 return false; 417 return false;
418 } 418 }
419 BITMAPINFOHEADER bmi = {0}; 419 BITMAPINFOHEADER bmi = {0};
420 gfx::CreateBitmapHeader(bitmap->width(), bitmap->height(), &bmi); 420 gfx::CreateBitmapHeader(bitmap->width(), bitmap->height(), &bmi);
421 res = (0 != StretchDIBits(hdc, sdib_record->xDest, sdib_record->yDest, 421 res = (0 != StretchDIBits(hdc, sdib_record->xDest, sdib_record->yDest,
422 sdib_record->cxDest, 422 sdib_record->cxDest,
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 RECT rect = page_bounds.ToRECT(); 669 RECT rect = page_bounds.ToRECT();
670 ::EnumEnhMetaFile(hdc, emf(), &RasterizeAlphaBlendProc, &bitmap_dc, &rect); 670 ::EnumEnhMetaFile(hdc, emf(), &RasterizeAlphaBlendProc, &bitmap_dc, &rect);
671 671
672 result->FinishDocument(); 672 result->FinishDocument();
673 673
674 return result.release(); 674 return result.release();
675 } 675 }
676 676
677 677
678 } // namespace printing 678 } // namespace printing
OLDNEW
« no previous file with comments | « content/renderer/webclipboard_impl.cc ('k') | skia/config/SkUserConfig.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698