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

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

Issue 849103004: Make SkStream *not* ref counted. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase, just in case. Created 5 years, 11 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
« no previous file with comments | « src/core/SkTypeface.cpp ('k') | src/fonts/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef UNICODE 8 #ifndef UNICODE
9 #define UNICODE 9 #define UNICODE
10 #endif 10 #endif
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 SkTAfter<SkSFNTHeader::TableDirectoryEntry>(sfntHeader); 394 SkTAfter<SkSFNTHeader::TableDirectoryEntry>(sfntHeader);
395 for (int i = 0; i < numTables; ++i, ++tableDirectory) { 395 for (int i = 0; i < numTables; ++i, ++tableDirectory) {
396 tableDirectory->offset = SkEndian_SwapBE32( 396 tableDirectory->offset = SkEndian_SwapBE32(
397 SkToU32(SkEndian_SwapBE32(SkToU32(tableDirectory->offset)) + ext ra)); 397 SkToU32(SkEndian_SwapBE32(SkToU32(tableDirectory->offset)) + ext ra));
398 } 398 }
399 } else { 399 } else {
400 extra = 0; 400 extra = 0;
401 fontPackageBuffer.realloc(bytesWritten); 401 fontPackageBuffer.realloc(bytesWritten);
402 } 402 }
403 403
404 SkAutoTUnref<SkMemoryStream> newStream(new SkMemoryStream()); 404 SkAutoTDelete<SkMemoryStream> newStream(new SkMemoryStream());
405 newStream->setMemoryOwned(fontPackageBuffer.detach(), bytesWritten + extra); 405 newStream->setMemoryOwned(fontPackageBuffer.detach(), bytesWritten + extra);
406 406
407 SkTScopedComPtr<IStream> newIStream; 407 SkTScopedComPtr<IStream> newIStream;
408 SkIStream::CreateFromSkStream(newStream.detach(), true, &newIStream); 408 SkIStream::CreateFromSkStream(newStream.detach(), true, &newIStream);
409 409
410 XPS_FONT_EMBEDDING embedding; 410 XPS_FONT_EMBEDDING embedding;
411 HRM(current->xpsFont->GetEmbeddingOption(&embedding), 411 HRM(current->xpsFont->GetEmbeddingOption(&embedding),
412 "Could not get embedding option from font."); 412 "Could not get embedding option from font.");
413 413
414 SkTScopedComPtr<IOpcPartUri> partUri; 414 SkTScopedComPtr<IOpcPartUri> partUri;
(...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after
2268 IID_PPV_ARGS(&this->fXpsFactory)), 2268 IID_PPV_ARGS(&this->fXpsFactory)),
2269 "Could not create factory for layer."); 2269 "Could not create factory for layer.");
2270 2270
2271 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas), 2271 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas),
2272 "Could not create canvas for layer."); 2272 "Could not create canvas for layer.");
2273 } 2273 }
2274 2274
2275 bool SkXPSDevice::allowImageFilter(const SkImageFilter*) { 2275 bool SkXPSDevice::allowImageFilter(const SkImageFilter*) {
2276 return false; 2276 return false;
2277 } 2277 }
OLDNEW
« no previous file with comments | « src/core/SkTypeface.cpp ('k') | src/fonts/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698