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

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

Issue 1235953004: Preserve SKP cullrects on deserialization (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | tests/PictureTest.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 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 "SkMessageBus.h" 9 #include "SkMessageBus.h"
10 #include "SkPicture.h" 10 #include "SkPicture.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } 127 }
128 return false; 128 return false;
129 } 129 }
130 130
131 SkPicture* SkPicture::Forwardport(const SkPictInfo& info, const SkPictureData* d ata) { 131 SkPicture* SkPicture::Forwardport(const SkPictInfo& info, const SkPictureData* d ata) {
132 if (!data) { 132 if (!data) {
133 return nullptr; 133 return nullptr;
134 } 134 }
135 SkPicturePlayback playback(data); 135 SkPicturePlayback playback(data);
136 SkPictureRecorder r; 136 SkPictureRecorder r;
137 playback.draw(r.beginRecording(SkScalarCeilToInt(info.fCullRect.width()), 137 playback.draw(r.beginRecording(info.fCullRect), nullptr/*no callback*/);
138 SkScalarCeilToInt(info.fCullRect.height())),
139 nullptr/*no callback*/);
140 return r.endRecording(); 138 return r.endRecording();
141 } 139 }
142 140
143 SkPicture* SkPicture::CreateFromStream(SkStream* stream, InstallPixelRefProc pro c) { 141 SkPicture* SkPicture::CreateFromStream(SkStream* stream, InstallPixelRefProc pro c) {
144 SkPictInfo info; 142 SkPictInfo info;
145 if (!InternalOnly_StreamIsSKP(stream, &info) || !stream->readBool()) { 143 if (!InternalOnly_StreamIsSKP(stream, &info) || !stream->readBool()) {
146 return nullptr; 144 return nullptr;
147 } 145 }
148 SkAutoTDelete<SkPictureData> data(SkPictureData::CreateFromStream(stream, in fo, proc)); 146 SkAutoTDelete<SkPictureData> data(SkPictureData::CreateFromStream(stream, in fo, proc));
149 return Forwardport(info, data); 147 return Forwardport(info, data);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 } 203 }
206 204
207 // Global setting to disable security precautions for serialization. 205 // Global setting to disable security precautions for serialization.
208 void SkPicture::SetPictureIOSecurityPrecautionsEnabled_Dangerous(bool set) { 206 void SkPicture::SetPictureIOSecurityPrecautionsEnabled_Dangerous(bool set) {
209 g_AllPictureIOSecurityPrecautionsEnabled = set; 207 g_AllPictureIOSecurityPrecautionsEnabled = set;
210 } 208 }
211 209
212 bool SkPicture::PictureIOSecurityPrecautionsEnabled() { 210 bool SkPicture::PictureIOSecurityPrecautionsEnabled() {
213 return g_AllPictureIOSecurityPrecautionsEnabled; 211 return g_AllPictureIOSecurityPrecautionsEnabled;
214 } 212 }
OLDNEW
« no previous file with comments | « no previous file | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698