| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkTypes.h" | 8 #include "SkTypes.h" |
| 9 #if defined(SK_BUILD_FOR_WIN32) | 9 #if defined(SK_BUILD_FOR_WIN32) |
| 10 | 10 |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 const SkMatrix& localMatrix, | 655 const SkMatrix& localMatrix, |
| 656 const SkShader::TileMode (&xy)[2], | 656 const SkShader::TileMode (&xy)[2], |
| 657 const SkAlpha alpha, | 657 const SkAlpha alpha, |
| 658 IXpsOMTileBrush** xpsBrush) { | 658 IXpsOMTileBrush** xpsBrush) { |
| 659 SkDynamicMemoryWStream write; | 659 SkDynamicMemoryWStream write; |
| 660 if (!SkImageEncoder::EncodeStream(&write, bitmap, | 660 if (!SkImageEncoder::EncodeStream(&write, bitmap, |
| 661 SkImageEncoder::kPNG_Type, 100)) { | 661 SkImageEncoder::kPNG_Type, 100)) { |
| 662 HRM(E_FAIL, "Unable to encode bitmap as png."); | 662 HRM(E_FAIL, "Unable to encode bitmap as png."); |
| 663 } | 663 } |
| 664 SkMemoryStream* read = new SkMemoryStream; | 664 SkMemoryStream* read = new SkMemoryStream; |
| 665 read->setData(write.copyToData())->unref(); | 665 read->setData(write.detachAsData()); |
| 666 SkTScopedComPtr<IStream> readWrapper; | 666 SkTScopedComPtr<IStream> readWrapper; |
| 667 HRM(SkIStream::CreateFromSkStream(read, true, &readWrapper), | 667 HRM(SkIStream::CreateFromSkStream(read, true, &readWrapper), |
| 668 "Could not create stream from png data."); | 668 "Could not create stream from png data."); |
| 669 | 669 |
| 670 const size_t size = | 670 const size_t size = |
| 671 SK_ARRAY_COUNT(L"/Documents/1/Resources/Images/" L_GUID_ID L".png"); | 671 SK_ARRAY_COUNT(L"/Documents/1/Resources/Images/" L_GUID_ID L".png"); |
| 672 wchar_t buffer[size]; | 672 wchar_t buffer[size]; |
| 673 wchar_t id[GUID_ID_LEN]; | 673 wchar_t id[GUID_ID_LEN]; |
| 674 HR(this->createId(id, GUID_ID_LEN)); | 674 HR(this->createId(id, GUID_ID_LEN)); |
| 675 swprintf_s(buffer, size, L"/Documents/1/Resources/Images/%s.png", id); | 675 swprintf_s(buffer, size, L"/Documents/1/Resources/Images/%s.png", id); |
| (...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2277 //SkXPSDevice* dev = new SkXPSDevice(this); | 2277 //SkXPSDevice* dev = new SkXPSDevice(this); |
| 2278 //SkSize s = SkSize::Make(width, height); | 2278 //SkSize s = SkSize::Make(width, height); |
| 2279 //dev->BeginCanvas(s, s, SkMatrix::I()); | 2279 //dev->BeginCanvas(s, s, SkMatrix::I()); |
| 2280 //return dev; | 2280 //return dev; |
| 2281 } | 2281 } |
| 2282 #endif | 2282 #endif |
| 2283 return new SkXPSDevice(this->fXpsFactory.get()); | 2283 return new SkXPSDevice(this->fXpsFactory.get()); |
| 2284 } | 2284 } |
| 2285 | 2285 |
| 2286 #endif//defined(SK_BUILD_FOR_WIN32) | 2286 #endif//defined(SK_BUILD_FOR_WIN32) |
| OLD | NEW |