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

Side by Side Diff: src/device/xps/SkXPSDevice.cpp

Issue 1018953003: Add SkEncodedFormat, used by SkCodec. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use a common enum for SkImageEncoder and SkImageDecoder and SkCodec Created 5 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
OLDNEW
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 9
10 #ifndef UNICODE 10 #ifndef UNICODE
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 }; 627 };
628 628
629 HRESULT SkXPSDevice::createXpsImageBrush( 629 HRESULT SkXPSDevice::createXpsImageBrush(
630 const SkBitmap& bitmap, 630 const SkBitmap& bitmap,
631 const SkMatrix& localMatrix, 631 const SkMatrix& localMatrix,
632 const SkShader::TileMode (&xy)[2], 632 const SkShader::TileMode (&xy)[2],
633 const SkAlpha alpha, 633 const SkAlpha alpha,
634 IXpsOMTileBrush** xpsBrush) { 634 IXpsOMTileBrush** xpsBrush) {
635 SkDynamicMemoryWStream write; 635 SkDynamicMemoryWStream write;
636 if (!SkImageEncoder::EncodeStream(&write, bitmap, 636 if (!SkImageEncoder::EncodeStream(&write, bitmap,
637 SkImageEncoder::kPNG_Type, 100)) { 637 kPNG_SkEncodedFormat, 100)) {
638 HRM(E_FAIL, "Unable to encode bitmap as png."); 638 HRM(E_FAIL, "Unable to encode bitmap as png.");
639 } 639 }
640 SkMemoryStream* read = new SkMemoryStream; 640 SkMemoryStream* read = new SkMemoryStream;
641 read->setData(write.copyToData())->unref(); 641 read->setData(write.copyToData())->unref();
642 SkTScopedComPtr<IStream> readWrapper; 642 SkTScopedComPtr<IStream> readWrapper;
643 HRM(SkIStream::CreateFromSkStream(read, true, &readWrapper), 643 HRM(SkIStream::CreateFromSkStream(read, true, &readWrapper),
644 "Could not create stream from png data."); 644 "Could not create stream from png data.");
645 645
646 const size_t size = 646 const size_t size =
647 SK_ARRAY_COUNT(L"/Documents/1/Resources/Images/" L_GUID_ID L".png"); 647 SK_ARRAY_COUNT(L"/Documents/1/Resources/Images/" L_GUID_ID L".png");
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after
2275 CLSID_XpsOMObjectFactory, 2275 CLSID_XpsOMObjectFactory,
2276 NULL, 2276 NULL,
2277 CLSCTX_INPROC_SERVER, 2277 CLSCTX_INPROC_SERVER,
2278 IID_PPV_ARGS(&this->fXpsFactory)), 2278 IID_PPV_ARGS(&this->fXpsFactory)),
2279 "Could not create factory for layer."); 2279 "Could not create factory for layer.");
2280 2280
2281 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas), 2281 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas),
2282 "Could not create canvas for layer."); 2282 "Could not create canvas for layer.");
2283 } 2283 }
2284 2284
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698