本文整理汇总了C++中SkDeque::back方法的典型用法代码示例。如果您正苦于以下问题:C++ SkDeque::back方法的具体用法?C++ SkDeque::back怎么用?C++ SkDeque::back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkDeque
的用法示例。
在下文中一共展示了SkDeque::back方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setStateStack
void setStateStack(SkDeque& stateStack)
{
while (stateStack.count() > 0)
{
State* copyState = static_cast<State*>(stateStack.back());
State* newState = static_cast<State*>(m_stateStack.push_back());
new (newState) State(*copyState);
stateStack.pop_back();
}
}
示例2: assert_count
static void assert_count(skiatest::Reporter* reporter, const SkDeque& deq, int count) {
if (0 == count) {
REPORTER_ASSERT(reporter, deq.empty());
REPORTER_ASSERT(reporter, 0 == deq.count());
REPORTER_ASSERT(reporter, sizeof(int) == deq.elemSize());
REPORTER_ASSERT(reporter, nullptr == deq.front());
REPORTER_ASSERT(reporter, nullptr == deq.back());
} else {
REPORTER_ASSERT(reporter, !deq.empty());
REPORTER_ASSERT(reporter, count == deq.count());
REPORTER_ASSERT(reporter, sizeof(int) == deq.elemSize());
REPORTER_ASSERT(reporter, deq.front());
REPORTER_ASSERT(reporter, deq.back());
if (1 == count) {
REPORTER_ASSERT(reporter, deq.back() == deq.front());
} else {
REPORTER_ASSERT(reporter, deq.back() != deq.front());
}
}
}
示例3: restore
void restore() {
mState->~State();
mStateStack.pop_back();
mState = (State*)mStateStack.back();
}