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

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

Issue 352643002: Prune some dead code from SkPicture.cpp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | no next file » | 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 /* 2 /*
3 * Copyright 2007 The Android Open Source Project 3 * Copyright 2007 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkPictureFlat.h" 10 #include "SkPictureFlat.h"
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 // TODO: remove this flag, since we're always float (now) 431 // TODO: remove this flag, since we're always float (now)
432 info->fFlags |= SkPictInfo::kScalarIsFloat_Flag; 432 info->fFlags |= SkPictInfo::kScalarIsFloat_Flag;
433 433
434 if (8 == sizeof(void*)) { 434 if (8 == sizeof(void*)) {
435 info->fFlags |= SkPictInfo::kPtrIs64Bit_Flag; 435 info->fFlags |= SkPictInfo::kPtrIs64Bit_Flag;
436 } 436 }
437 } 437 }
438 438
439 // fRecord TODO 439 // fRecord TODO
440 void SkPicture::serialize(SkWStream* stream, EncodeBitmap encoder) const { 440 void SkPicture::serialize(SkWStream* stream, EncodeBitmap encoder) const {
441 SkPicturePlayback* playback = fPlayback.get();
442
443 SkPictInfo info; 441 SkPictInfo info;
444 this->createHeader(&info); 442 this->createHeader(&info);
445 stream->write(&info, sizeof(info)); 443 stream->write(&info, sizeof(info));
446 if (playback) { 444
445 if (NULL != fPlayback.get()) {
447 stream->writeBool(true); 446 stream->writeBool(true);
448 playback->serialize(stream, encoder); 447 fPlayback->serialize(stream, encoder);
449 // delete playback if it is a local version (i.e. cons'd up just now)
450 if (playback != fPlayback.get()) {
451 SkDELETE(playback);
452 }
453 } else { 448 } else {
454 stream->writeBool(false); 449 stream->writeBool(false);
455 } 450 }
456 } 451 }
457 452
458 // fRecord OK 453 // fRecord OK
459 void SkPicture::WriteTagSize(SkWriteBuffer& buffer, uint32_t tag, size_t size) { 454 void SkPicture::WriteTagSize(SkWriteBuffer& buffer, uint32_t tag, size_t size) {
460 buffer.writeUInt(tag); 455 buffer.writeUInt(tag);
461 buffer.writeUInt(SkToU32(size)); 456 buffer.writeUInt(SkToU32(size));
462 } 457 }
463 458
464 // fRecord OK 459 // fRecord OK
465 void SkPicture::WriteTagSize(SkWStream* stream, uint32_t tag, size_t size) { 460 void SkPicture::WriteTagSize(SkWStream* stream, uint32_t tag, size_t size) {
466 stream->write32(tag); 461 stream->write32(tag);
467 stream->write32(SkToU32(size)); 462 stream->write32(SkToU32(size));
468 } 463 }
469 464
470 // fRecord TODO 465 // fRecord TODO
471 void SkPicture::flatten(SkWriteBuffer& buffer) const { 466 void SkPicture::flatten(SkWriteBuffer& buffer) const {
472 SkPicturePlayback* playback = fPlayback.get();
473
474 SkPictInfo info; 467 SkPictInfo info;
475 this->createHeader(&info); 468 this->createHeader(&info);
476 buffer.writeByteArray(&info, sizeof(info)); 469 buffer.writeByteArray(&info, sizeof(info));
477 if (playback) { 470
471 if (NULL != fPlayback.get()) {
478 buffer.writeBool(true); 472 buffer.writeBool(true);
479 playback->flatten(buffer); 473 fPlayback->flatten(buffer);
480 // delete playback if it is a local version (i.e. cons'd up just now)
481 if (playback != fPlayback.get()) {
482 SkDELETE(playback);
483 }
484 } else { 474 } else {
485 buffer.writeBool(false); 475 buffer.writeBool(false);
486 } 476 }
487 } 477 }
488 478
489 #if SK_SUPPORT_GPU 479 #if SK_SUPPORT_GPU
490 // fRecord TODO 480 // fRecord TODO
491 bool SkPicture::suitableForGpuRasterization(GrContext* context, const char **rea son) const { 481 bool SkPicture::suitableForGpuRasterization(GrContext* context, const char **rea son) const {
492 if (NULL == fPlayback.get()) { 482 if (NULL == fPlayback.get()) {
493 if (NULL != reason) { 483 if (NULL != reason) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 return fUniqueID; 528 return fUniqueID;
539 } 529 }
540 530
541 // fRecord OK 531 // fRecord OK
542 SkPicture::SkPicture(int width, int height, SkRecord* record) 532 SkPicture::SkPicture(int width, int height, SkRecord* record)
543 : fWidth(width) 533 : fWidth(width)
544 , fHeight(height) 534 , fHeight(height)
545 , fRecord(record) { 535 , fRecord(record) {
546 this->needsNewGenID(); 536 this->needsNewGenID();
547 } 537 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698