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

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

Issue 167683006: Offer single-param version of deepCopyTo -- much easier to migrate to colortypes (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/image/SkSurface_Raster.cpp ('k') | tests/GpuBitmapCopyTest.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 2010 The Android Open Source Project 2 * Copyright 2010 The Android Open Source Project
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 "SkPDFImage.h" 8 #include "SkPDFImage.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 bool isAlpha, 500 bool isAlpha,
501 const SkIRect& srcRect, 501 const SkIRect& srcRect,
502 SkPicture::EncodeBitmap encoder) 502 SkPicture::EncodeBitmap encoder)
503 : fIsAlpha(isAlpha), 503 : fIsAlpha(isAlpha),
504 fSrcRect(srcRect), 504 fSrcRect(srcRect),
505 fEncoder(encoder) { 505 fEncoder(encoder) {
506 506
507 if (bitmap.isImmutable()) { 507 if (bitmap.isImmutable()) {
508 fBitmap = bitmap; 508 fBitmap = bitmap;
509 } else { 509 } else {
510 bitmap.deepCopyTo(&fBitmap, bitmap.config()); 510 bitmap.deepCopyTo(&fBitmap);
511 fBitmap.setImmutable(); 511 fBitmap.setImmutable();
512 } 512 }
513 513
514 if (stream != NULL) { 514 if (stream != NULL) {
515 setData(stream); 515 setData(stream);
516 fStreamValid = true; 516 fStreamValid = true;
517 } else { 517 } else {
518 fStreamValid = false; 518 fStreamValid = false;
519 } 519 }
520 520
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 // but the new catalog wants it compressed. 626 // but the new catalog wants it compressed.
627 if (!getSubstitute()) { 627 if (!getSubstitute()) {
628 SkPDFStream* substitute = SkNEW_ARGS(SkPDFImage, (*this)); 628 SkPDFStream* substitute = SkNEW_ARGS(SkPDFImage, (*this));
629 setSubstitute(substitute); 629 setSubstitute(substitute);
630 catalog->setSubstitute(this, substitute); 630 catalog->setSubstitute(this, substitute);
631 } 631 }
632 return false; 632 return false;
633 } 633 }
634 return true; 634 return true;
635 } 635 }
OLDNEW
« no previous file with comments | « src/image/SkSurface_Raster.cpp ('k') | tests/GpuBitmapCopyTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698