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

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

Issue 1779263003: Make sp variants for SkData (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/SkPaint.cpp ('k') | src/core/SkPictureData.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 2007 The Android Open Source Project 2 * Copyright 2007 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 "SkAtomics.h" 8 #include "SkAtomics.h"
9 #include "SkImageGenerator.h" 9 #include "SkImageGenerator.h"
10 #include "SkMessageBus.h" 10 #include "SkMessageBus.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 if (!data) { 133 if (!data) {
134 return nullptr; 134 return nullptr;
135 } 135 }
136 SkPicturePlayback playback(data); 136 SkPicturePlayback playback(data);
137 SkPictureRecorder r; 137 SkPictureRecorder r;
138 playback.draw(r.beginRecording(info.fCullRect), nullptr/*no callback*/); 138 playback.draw(r.beginRecording(info.fCullRect), nullptr/*no callback*/);
139 return r.endRecording(); 139 return r.endRecording();
140 } 140 }
141 141
142 static bool default_install(const void* src, size_t length, SkBitmap* dst) { 142 static bool default_install(const void* src, size_t length, SkBitmap* dst) {
143 SkAutoTUnref<SkData> encoded(SkData::NewWithCopy(src, length)); 143 sk_sp<SkData> encoded(SkData::MakeWithCopy(src, length));
144 return encoded && SkDEPRECATED_InstallDiscardablePixelRef( 144 return encoded && SkDEPRECATED_InstallDiscardablePixelRef(
145 SkImageGenerator::NewFromEncoded(encoded), dst); 145 SkImageGenerator::NewFromEncoded(encoded.get()), dst);
146 } 146 }
147 147
148 SkPicture* SkPicture::CreateFromStream(SkStream* stream) { 148 SkPicture* SkPicture::CreateFromStream(SkStream* stream) {
149 return CreateFromStream(stream, &default_install, nullptr); 149 return CreateFromStream(stream, &default_install, nullptr);
150 } 150 }
151 151
152 SkPicture* SkPicture::CreateFromStream(SkStream* stream, InstallPixelRefProc pro c) { 152 SkPicture* SkPicture::CreateFromStream(SkStream* stream, InstallPixelRefProc pro c) {
153 return CreateFromStream(stream, proc, nullptr); 153 return CreateFromStream(stream, proc, nullptr);
154 } 154 }
155 155
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 } 227 }
228 228
229 // Global setting to disable security precautions for serialization. 229 // Global setting to disable security precautions for serialization.
230 void SkPicture::SetPictureIOSecurityPrecautionsEnabled_Dangerous(bool set) { 230 void SkPicture::SetPictureIOSecurityPrecautionsEnabled_Dangerous(bool set) {
231 g_AllPictureIOSecurityPrecautionsEnabled = set; 231 g_AllPictureIOSecurityPrecautionsEnabled = set;
232 } 232 }
233 233
234 bool SkPicture::PictureIOSecurityPrecautionsEnabled() { 234 bool SkPicture::PictureIOSecurityPrecautionsEnabled() {
235 return g_AllPictureIOSecurityPrecautionsEnabled; 235 return g_AllPictureIOSecurityPrecautionsEnabled;
236 } 236 }
OLDNEW
« no previous file with comments | « src/core/SkPaint.cpp ('k') | src/core/SkPictureData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698