本文整理汇总了C++中SkMatrix::writeToMemory方法的典型用法代码示例。如果您正苦于以下问题:C++ SkMatrix::writeToMemory方法的具体用法?C++ SkMatrix::writeToMemory怎么用?C++ SkMatrix::writeToMemory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkMatrix
的用法示例。
在下文中一共展示了SkMatrix::writeToMemory方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: didSetMatrix
void SkGPipeCanvas::didSetMatrix(const SkMatrix& matrix) {
NOTIFY_SETUP(this);
if (this->needOpBytes(matrix.writeToMemory(nullptr))) {
this->writeOp(kSetMatrix_DrawOp);
fWriter.writeMatrix(matrix);
}
this->INHERITED::didSetMatrix(matrix);
}
示例2: recordConcat
void SkPictureRecord::recordConcat(const SkMatrix& matrix) {
this->validate(fWriter.bytesWritten(), 0);
// op + matrix
size_t size = kUInt32Size + matrix.writeToMemory(nullptr);
size_t initialOffset = this->addDraw(CONCAT, &size);
this->addMatrix(matrix);
this->validate(initialOffset, size);
}
示例3: didSetMatrix
void SkPictureRecord::didSetMatrix(const SkMatrix& matrix) {
this->validate(fWriter.bytesWritten(), 0);
// op + matrix
size_t size = kUInt32Size + matrix.writeToMemory(nullptr);
size_t initialOffset = this->addDraw(SET_MATRIX, &size);
this->addMatrix(matrix);
this->validate(initialOffset, size);
this->INHERITED::didSetMatrix(matrix);
}
示例4: test_flatten
static void test_flatten(skiatest::Reporter* reporter, const SkMatrix& m) {
// add 100 in case we have a bug, I don't want to kill my stack in the test
char buffer[SkMatrix::kMaxFlattenSize + 100];
uint32_t size1 = m.writeToMemory(NULL);
uint32_t size2 = m.writeToMemory(buffer);
REPORTER_ASSERT(reporter, size1 == size2);
REPORTER_ASSERT(reporter, size1 <= SkMatrix::kMaxFlattenSize);
SkMatrix m2;
uint32_t size3 = m2.readFromMemory(buffer);
REPORTER_ASSERT(reporter, size1 == size3);
REPORTER_ASSERT(reporter, are_equal(reporter, m, m2));
char buffer2[SkMatrix::kMaxFlattenSize + 100];
size3 = m2.writeToMemory(buffer2);
REPORTER_ASSERT(reporter, size1 == size3);
REPORTER_ASSERT(reporter, memcmp(buffer, buffer2, size1) == 0);
}
示例5: recordConcat
void SkGPipeCanvas::recordConcat(const SkMatrix& m) {
if (this->needOpBytes(m.writeToMemory(nullptr))) {
this->writeOp(kConcat_DrawOp);
fWriter.writeMatrix(m);
}
}