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

Side by Side Diff: src/core/SkPictureRecord.cpp

Issue 1817383002: switch surface to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/core/SkPictureRecord.h ('k') | src/core/SkPixmap.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 "SkPictureRecord.h" 8 #include "SkPictureRecord.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkImage_Base.h" 10 #include "SkImage_Base.h"
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 784
785 size_t initialOffset = this->addDraw(DRAW_ANNOTATION, &size); 785 size_t initialOffset = this->addDraw(DRAW_ANNOTATION, &size);
786 this->addRect(rect); 786 this->addRect(rect);
787 fWriter.writeString(key); 787 fWriter.writeString(key);
788 fWriter.writeData(value); 788 fWriter.writeData(value);
789 this->validate(initialOffset, size); 789 this->validate(initialOffset, size);
790 } 790 }
791 791
792 /////////////////////////////////////////////////////////////////////////////// 792 ///////////////////////////////////////////////////////////////////////////////
793 793
794 SkSurface* SkPictureRecord::onNewSurface(const SkImageInfo& info, const SkSurfac eProps&) { 794 sk_sp<SkSurface> SkPictureRecord::onNewSurface(const SkImageInfo& info, const Sk SurfaceProps&) {
795 return nullptr; 795 return nullptr;
796 } 796 }
797 797
798 // If we already have a stored, can we reuse it instead of also storing b? 798 // If we already have a stored, can we reuse it instead of also storing b?
799 static bool equivalent(const SkBitmap& a, const SkBitmap& b) { 799 static bool equivalent(const SkBitmap& a, const SkBitmap& b) {
800 if (a.info() != b.info() || a.pixelRefOrigin() != b.pixelRefOrigin()) { 800 if (a.info() != b.info() || a.pixelRefOrigin() != b.pixelRefOrigin()) {
801 // Requiring a.info() == b.info() may be overkill in some cases (alphaty pe mismatch), 801 // Requiring a.info() == b.info() may be overkill in some cases (alphaty pe mismatch),
802 // but it sure makes things easier to reason about below. 802 // but it sure makes things easier to reason about below.
803 return false; 803 return false;
804 } 804 }
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 void SkPictureRecord::addTextBlob(const SkTextBlob *blob) { 969 void SkPictureRecord::addTextBlob(const SkTextBlob *blob) {
970 int index = fTextBlobRefs.count(); 970 int index = fTextBlobRefs.count();
971 *fTextBlobRefs.append() = blob; 971 *fTextBlobRefs.append() = blob;
972 blob->ref(); 972 blob->ref();
973 // follow the convention of recording a 1-based index 973 // follow the convention of recording a 1-based index
974 this->addInt(index + 1); 974 this->addInt(index + 1);
975 } 975 }
976 976
977 /////////////////////////////////////////////////////////////////////////////// 977 ///////////////////////////////////////////////////////////////////////////////
978 978
OLDNEW
« no previous file with comments | « src/core/SkPictureRecord.h ('k') | src/core/SkPixmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698