| OLD | NEW |
| 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 "SkBBoxHierarchy.h" | 9 #include "SkBBoxHierarchy.h" |
| 10 #include "SkDevice.h" | 10 #include "SkDevice.h" |
| (...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1422 size_t initialOffset = this->addDraw(POP_CULL, &size); | 1422 size_t initialOffset = this->addDraw(POP_CULL, &size); |
| 1423 | 1423 |
| 1424 // update the cull skip offset to point past this op. | 1424 // update the cull skip offset to point past this op. |
| 1425 fWriter.overwriteTAt<uint32_t>(cullSkipOffset, SkToU32(fWriter.bytesWritten(
))); | 1425 fWriter.overwriteTAt<uint32_t>(cullSkipOffset, SkToU32(fWriter.bytesWritten(
))); |
| 1426 | 1426 |
| 1427 this->validate(initialOffset, size); | 1427 this->validate(initialOffset, size); |
| 1428 } | 1428 } |
| 1429 | 1429 |
| 1430 /////////////////////////////////////////////////////////////////////////////// | 1430 /////////////////////////////////////////////////////////////////////////////// |
| 1431 | 1431 |
| 1432 SkSurface* SkPictureRecord::onNewSurface(const SkImageInfo& info) { | 1432 SkSurface* SkPictureRecord::onNewSurface(const SkImageInfo& info, const SkSurfac
eProps&) { |
| 1433 return NULL; | 1433 return NULL; |
| 1434 } | 1434 } |
| 1435 | 1435 |
| 1436 int SkPictureRecord::addBitmap(const SkBitmap& bitmap) { | 1436 int SkPictureRecord::addBitmap(const SkBitmap& bitmap) { |
| 1437 const int index = fBitmapHeap->insert(bitmap); | 1437 const int index = fBitmapHeap->insert(bitmap); |
| 1438 // In debug builds, a bad return value from insert() will crash, allowing fo
r debugging. In | 1438 // In debug builds, a bad return value from insert() will crash, allowing fo
r debugging. In |
| 1439 // release builds, the invalid value will be recorded so that the reader wil
l know that there | 1439 // release builds, the invalid value will be recorded so that the reader wil
l know that there |
| 1440 // was a problem. | 1440 // was a problem. |
| 1441 SkASSERT(index != SkBitmapHeap::INVALID_SLOT); | 1441 SkASSERT(index != SkBitmapHeap::INVALID_SLOT); |
| 1442 this->addInt(index); | 1442 this->addInt(index); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1544 void SkPictureRecord::addTextBlob(const SkTextBlob *blob) { | 1544 void SkPictureRecord::addTextBlob(const SkTextBlob *blob) { |
| 1545 int index = fTextBlobRefs.count(); | 1545 int index = fTextBlobRefs.count(); |
| 1546 *fTextBlobRefs.append() = blob; | 1546 *fTextBlobRefs.append() = blob; |
| 1547 blob->ref(); | 1547 blob->ref(); |
| 1548 // follow the convention of recording a 1-based index | 1548 // follow the convention of recording a 1-based index |
| 1549 this->addInt(index + 1); | 1549 this->addInt(index + 1); |
| 1550 } | 1550 } |
| 1551 | 1551 |
| 1552 /////////////////////////////////////////////////////////////////////////////// | 1552 /////////////////////////////////////////////////////////////////////////////// |
| 1553 | 1553 |
| OLD | NEW |