本文整理汇总了C++中SkDrawBitmapRectCommand::bitmap方法的典型用法代码示例。如果您正苦于以下问题:C++ SkDrawBitmapRectCommand::bitmap方法的具体用法?C++ SkDrawBitmapRectCommand::bitmap怎么用?C++ SkDrawBitmapRectCommand::bitmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkDrawBitmapRectCommand
的用法示例。
在下文中一共展示了SkDrawBitmapRectCommand::bitmap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// Check for:
// SAVE
// CLIP_RECT
// DRAWBITMAPRECTTORECT
// RESTORE
// where:
// the drawBitmapRectToRect is a 1-1 copy from src to dest
// the clip rect is BW and a subset of the drawBitmapRectToRect's dest rect
static bool check_8(SkDebugCanvas* canvas, int curCommand) {
if (SAVE != canvas->getDrawCommandAt(curCommand)->getType() ||
canvas->getSize() <= curCommand+4 ||
CLIP_RECT != canvas->getDrawCommandAt(curCommand+1)->getType() ||
DRAW_BITMAP_RECT_TO_RECT != canvas->getDrawCommandAt(curCommand+2)->getType() ||
RESTORE != canvas->getDrawCommandAt(curCommand+3)->getType()) {
return false;
}
SkClipRectCommand* clip =
(SkClipRectCommand*) canvas->getDrawCommandAt(curCommand+1);
SkDrawBitmapRectCommand* dbmr =
(SkDrawBitmapRectCommand*) canvas->getDrawCommandAt(curCommand+2);
if (clip->doAA() || SkRegion::kIntersect_Op != clip->op()) {
return false;
}
// The src->dest mapping needs to be 1-to-1
if (NULL == dbmr->srcRect()) {
if (dbmr->bitmap().width() != dbmr->dstRect().width() ||
dbmr->bitmap().height() != dbmr->dstRect().height()) {
return false;
}
} else {
if (dbmr->srcRect()->width() != dbmr->dstRect().width() ||
dbmr->srcRect()->height() != dbmr->dstRect().height()) {
return false;
}
}
if (!dbmr->dstRect().contains(clip->rect())) {
return false;
}
return true;
}