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

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

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 4 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
« no previous file with comments | « src/xps/SkDocument_XPS.cpp ('k') | tests/BadIcoTest.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 #include "SkTypes.h" 8 #include "SkTypes.h"
9 #if defined(SK_BUILD_FOR_WIN32) 9 #if defined(SK_BUILD_FOR_WIN32)
10 10
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 for (int i = 0; i < numTables; ++i, ++tableDirectory) { 413 for (int i = 0; i < numTables; ++i, ++tableDirectory) {
414 tableDirectory->offset = SkEndian_SwapBE32( 414 tableDirectory->offset = SkEndian_SwapBE32(
415 SkToU32(SkEndian_SwapBE32(SkToU32(tableDirectory->offset)) + ext ra)); 415 SkToU32(SkEndian_SwapBE32(SkToU32(tableDirectory->offset)) + ext ra));
416 } 416 }
417 } else { 417 } else {
418 extra = 0; 418 extra = 0;
419 fontPackageBuffer.realloc(bytesWritten); 419 fontPackageBuffer.realloc(bytesWritten);
420 } 420 }
421 421
422 SkAutoTDelete<SkMemoryStream> newStream(new SkMemoryStream()); 422 SkAutoTDelete<SkMemoryStream> newStream(new SkMemoryStream());
423 newStream->setMemoryOwned(fontPackageBuffer.detach(), bytesWritten + extra); 423 newStream->setMemoryOwned(fontPackageBuffer.release(), bytesWritten + extra) ;
424 424
425 SkTScopedComPtr<IStream> newIStream; 425 SkTScopedComPtr<IStream> newIStream;
426 SkIStream::CreateFromSkStream(newStream.detach(), true, &newIStream); 426 SkIStream::CreateFromSkStream(newStream.release(), true, &newIStream);
427 427
428 XPS_FONT_EMBEDDING embedding; 428 XPS_FONT_EMBEDDING embedding;
429 HRM(current->xpsFont->GetEmbeddingOption(&embedding), 429 HRM(current->xpsFont->GetEmbeddingOption(&embedding),
430 "Could not get embedding option from font."); 430 "Could not get embedding option from font.");
431 431
432 SkTScopedComPtr<IOpcPartUri> partUri; 432 SkTScopedComPtr<IOpcPartUri> partUri;
433 HRM(current->xpsFont->GetPartName(&partUri), 433 HRM(current->xpsFont->GetPartName(&partUri),
434 "Could not get part uri from font."); 434 "Could not get part uri from font.");
435 435
436 HRM(current->xpsFont->SetContent( 436 HRM(current->xpsFont->SetContent(
(...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after
2258 //SkXPSDevice* dev = new SkXPSDevice(this); 2258 //SkXPSDevice* dev = new SkXPSDevice(this);
2259 //SkSize s = SkSize::Make(width, height); 2259 //SkSize s = SkSize::Make(width, height);
2260 //dev->BeginCanvas(s, s, SkMatrix::I()); 2260 //dev->BeginCanvas(s, s, SkMatrix::I());
2261 //return dev; 2261 //return dev;
2262 } 2262 }
2263 #endif 2263 #endif
2264 return new SkXPSDevice(this->fXpsFactory.get()); 2264 return new SkXPSDevice(this->fXpsFactory.get());
2265 } 2265 }
2266 2266
2267 #endif//defined(SK_BUILD_FOR_WIN32) 2267 #endif//defined(SK_BUILD_FOR_WIN32)
OLDNEW
« no previous file with comments | « src/xps/SkDocument_XPS.cpp ('k') | tests/BadIcoTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698