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

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

Issue 770703002: Bump min picture version. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: TODO Created 6 years 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/SkPicture.cpp ('k') | src/core/SkReadBuffer.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 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 #include <new> 7 #include <new>
8 #include "SkBBoxHierarchy.h" 8 #include "SkBBoxHierarchy.h"
9 #include "SkDrawPictureCallback.h" 9 #include "SkDrawPictureCallback.h"
10 #include "SkPictureData.h" 10 #include "SkPictureData.h"
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 switch (tag) { 314 switch (tag) {
315 case SK_PICT_READER_TAG: 315 case SK_PICT_READER_TAG:
316 SkASSERT(NULL == fOpData); 316 SkASSERT(NULL == fOpData);
317 fOpData = SkData::NewFromStream(stream, size); 317 fOpData = SkData::NewFromStream(stream, size);
318 if (!fOpData) { 318 if (!fOpData) {
319 return false; 319 return false;
320 } 320 }
321 break; 321 break;
322 case SK_PICT_FACTORY_TAG: { 322 case SK_PICT_FACTORY_TAG: {
323 SkASSERT(!haveBuffer); 323 SkASSERT(!haveBuffer);
324 // Remove this code when v21 and below are no longer supported. At the 324 size = stream->readU32();
325 // same time add a new 'count' variable and use it rather then reusing ' size'.
326 #ifndef DISABLE_V21_COMPATIBILITY_CODE
327 if (fInfo.fVersion >= 22) {
328 // in v22 this tag's size represents the size of the chunk in by tes
329 // and the number of factory strings is written out separately
330 #endif
331 size = stream->readU32();
332 #ifndef DISABLE_V21_COMPATIBILITY_CODE
333 }
334 #endif
335 fFactoryPlayback = SkNEW_ARGS(SkFactoryPlayback, (size)); 325 fFactoryPlayback = SkNEW_ARGS(SkFactoryPlayback, (size));
336 for (size_t i = 0; i < size; i++) { 326 for (size_t i = 0; i < size; i++) {
337 SkString str; 327 SkString str;
338 const size_t len = stream->readPackedUInt(); 328 const size_t len = stream->readPackedUInt();
339 str.resize(len); 329 str.resize(len);
340 if (stream->read(str.writable_str(), len) != len) { 330 if (stream->read(str.writable_str(), len) != len) {
341 return false; 331 return false;
342 } 332 }
343 fFactoryPlayback->base()[i] = SkFlattenable::NameToFactory(str.c _str()); 333 fFactoryPlayback->base()[i] = SkFlattenable::NameToFactory(str.c _str());
344 } 334 }
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 } 573 }
584 } 574 }
585 575
586 bool SkPictureData::suitableForLayerOptimization() const { 576 bool SkPictureData::suitableForLayerOptimization() const {
587 return fContentInfo.numLayers() > 0; 577 return fContentInfo.numLayers() > 0;
588 } 578 }
589 #endif 579 #endif
590 /////////////////////////////////////////////////////////////////////////////// 580 ///////////////////////////////////////////////////////////////////////////////
591 581
592 582
OLDNEW
« no previous file with comments | « src/core/SkPicture.cpp ('k') | src/core/SkReadBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698