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

Side by Side Diff: src/pdf/SkPDFBitmap.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 3 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/pdf/SkDeflate.cpp ('k') | src/pdf/SkPDFDevice.h » ('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 2015 Google Inc. 2 * Copyright 2015 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 "SkColorPriv.h" 8 #include "SkColorPriv.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkDeflate.h" 10 #include "SkDeflate.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 if (fSMask.get()) { 307 if (fSMask.get()) {
308 SkPDFObject* obj = substitutes.getSubstitute(fSMask.get()); 308 SkPDFObject* obj = substitutes.getSubstitute(fSMask.get());
309 SkASSERT(obj); 309 SkASSERT(obj);
310 if (catalog->addObject(obj)) { 310 if (catalog->addObject(obj)) {
311 obj->addResources(catalog, substitutes); 311 obj->addResources(catalog, substitutes);
312 } 312 }
313 } 313 }
314 } 314 }
315 315
316 static SkPDFArray* make_indexed_color_space(const SkColorTable* table) { 316 static SkPDFArray* make_indexed_color_space(const SkColorTable* table) {
317 SkPDFArray* result = SkNEW(SkPDFArray); 317 SkPDFArray* result = new SkPDFArray;
318 result->reserve(4); 318 result->reserve(4);
319 result->appendName("Indexed"); 319 result->appendName("Indexed");
320 result->appendName("DeviceRGB"); 320 result->appendName("DeviceRGB");
321 SkASSERT(table); 321 SkASSERT(table);
322 if (table->count() < 1) { 322 if (table->count() < 1) {
323 result->appendInt(0); 323 result->appendInt(0);
324 char shortTableArray[3] = {0, 0, 0}; 324 char shortTableArray[3] = {0, 0, 0};
325 SkString tableString(shortTableArray, SK_ARRAY_COUNT(shortTableArray)); 325 SkString tableString(shortTableArray, SK_ARRAY_COUNT(shortTableArray));
326 result->appendString(tableString); 326 result->appendString(tableString);
327 return result; 327 return result;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 return SkRef(canonBitmap); 450 return SkRef(canonBitmap);
451 } 451 }
452 452
453 if (bm.pixelRef() && bm.pixelRefOrigin().isZero() && 453 if (bm.pixelRef() && bm.pixelRefOrigin().isZero() &&
454 bm.dimensions() == bm.pixelRef()->info().dimensions()) { 454 bm.dimensions() == bm.pixelRef()->info().dimensions()) {
455 // Requires the bitmap to be backed by lazy pixels. 455 // Requires the bitmap to be backed by lazy pixels.
456 SkAutoTUnref<SkData> data(bm.pixelRef()->refEncodedData()); 456 SkAutoTUnref<SkData> data(bm.pixelRef()->refEncodedData());
457 SkJFIFInfo info; 457 SkJFIFInfo info;
458 if (data && SkIsJFIF(data, &info)) { 458 if (data && SkIsJFIF(data, &info)) {
459 bool yuv = info.fType == SkJFIFInfo::kYCbCr; 459 bool yuv = info.fType == SkJFIFInfo::kYCbCr;
460 SkPDFBitmap* pdfBitmap = SkNEW_ARGS(PDFJpegBitmap, (bm, data, yuv)); 460 SkPDFBitmap* pdfBitmap = new PDFJpegBitmap(bm, data, yuv);
461 canon->addBitmap(pdfBitmap); 461 canon->addBitmap(pdfBitmap);
462 return pdfBitmap; 462 return pdfBitmap;
463 } 463 }
464 } 464 }
465 465
466 SkPDFObject* smask = NULL; 466 SkPDFObject* smask = NULL;
467 if (!bm.isOpaque() && !SkBitmap::ComputeIsOpaque(bm)) { 467 if (!bm.isOpaque() && !SkBitmap::ComputeIsOpaque(bm)) {
468 smask = SkNEW_ARGS(PDFAlphaBitmap, (bm)); 468 smask = new PDFAlphaBitmap(bm);
469 } 469 }
470 SkPDFBitmap* pdfBitmap = SkNEW_ARGS(PDFDefaultBitmap, (bm, smask)); 470 SkPDFBitmap* pdfBitmap = new PDFDefaultBitmap(bm, smask);
471 canon->addBitmap(pdfBitmap); 471 canon->addBitmap(pdfBitmap);
472 return pdfBitmap; 472 return pdfBitmap;
473 } 473 }
OLDNEW
« no previous file with comments | « src/pdf/SkDeflate.cpp ('k') | src/pdf/SkPDFDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698