OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |