bool Instruction::setIndirect(int s, int dim, Value *value) { assert(this->srcExists(s)); int p = srcs[s].indirect[dim]; if (p < 0) { if (!value) return true; p = srcs.size(); while (p > 0 && !srcExists(p - 1)) --p; } setSrc(p, value); srcs[p].usedAsPtr = (value != 0); srcs[s].indirect[dim] = value ? p : -1; return true; }
TEST_F(HTMLVideoElementTest, setBufferingStrategy_NonUserPause) { setSrc("http://foo.bar/"); MockWebMediaPlayer* player = webMediaPlayer(); ASSERT_TRUE(player); // On play, the strategy is set to normal. EXPECT_CALL(*player, setBufferingStrategy(WebMediaPlayer::BufferingStrategy::Normal)); m_video->play(); ::testing::Mock::VerifyAndClearExpectations(player); // On a non-user pause, the strategy is not changed. m_video->pause(); ::testing::Mock::VerifyAndClearExpectations(player); // On play, the strategy is set to normal. EXPECT_CALL(*player, setBufferingStrategy(WebMediaPlayer::BufferingStrategy::Normal)); m_video->play(); ::testing::Mock::VerifyAndClearExpectations(player); }
void BaseObject::parse( BaseObjectDescription* arg ) { if (arg->getAttribute("src")) { std::string valueString(arg->getAttribute("src")); if (valueString[0] != '@') { serr<<"ERROR: 'src' attribute value should be a link using '@'" << sendl; } else { std::vector< std::string > attributeList; arg->getAttributeList(attributeList); setSrc(valueString, &attributeList); } arg->removeAttribute("src"); } Base::parse(arg); }
void ImageButton::parseAttr(std::vector<std::string>* keys, std::vector<std::string>* values) { Button::parseAttr(keys, values); for (auto i = 0; i < keys->size(); ++i) { const auto& _key = keys->at(i); const auto& _value = values->at(i); if (_key == "src" || _key == "source" || _key == "upsrc" || _key == "upsource" || _key == "srcup") { setSrc(_value); } else if (_key == "srcdown" || _key == "downsrc" || _key == "downsource" || _key == "downsource") { setSrcDown(_value); } else if (_key == "srcdisabled" || _key == "disabledsrc" || _key == "disabledsource" || _key == "disablesource" || _key == "disabledsource") { setSrcDisabled(_value); } } }
bool Instruction::setPredicate(CondCode ccode, Value *value) { cc = ccode; if (!value) { if (predSrc >= 0) { srcs[predSrc].set(NULL); predSrc = -1; } return true; } if (predSrc < 0) { predSrc = srcs.size(); while (predSrc > 0 && !srcExists(predSrc - 1)) --predSrc; } setSrc(predSrc, value); return true; }
static Bool prepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int dx, int dy, int alu, Pixel planemask) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pDstPixmap->drawable.pScreen); G80Ptr pNv = G80PTR(pScrn); if(!setSrc(pNv, pSrcPixmap)) return FALSE; if(!setDst(pNv, pDstPixmap)) return FALSE; G80DmaStart(pNv, 0x2ac, 1); if(alu == GXcopy && planemask == ~0) { G80DmaNext (pNv, 3); } else { G80DmaNext (pNv, 4); G80SetRopSolid(pNv, alu, planemask); } pNv->DMAKickoffCallback = G80DMAKickoffCallback; return TRUE; }
TEST_F(HTMLVideoElementTest, setBufferingStrategy_UserPause) { setSrc("http://foo.bar/"); MockWebMediaPlayer* player = webMediaPlayer(); ASSERT_TRUE(player); // On play, the strategy is set to normal. EXPECT_CALL(*player, setBufferingStrategy(WebMediaPlayer::BufferingStrategy::Normal)); m_video->play(); ::testing::Mock::VerifyAndClearExpectations(player); // On a user pause, the strategy is set to aggressive. EXPECT_CALL(*player, setBufferingStrategy(WebMediaPlayer::BufferingStrategy::Aggressive)); { UserGestureIndicator gesture(DefinitelyProcessingUserGesture); m_video->pause(); } ::testing::Mock::VerifyAndClearExpectations(player); // On play, the strategy is set to normal. EXPECT_CALL(*player, setBufferingStrategy(WebMediaPlayer::BufferingStrategy::Normal)); m_video->play(); ::testing::Mock::VerifyAndClearExpectations(player); }
void Instruction::setSrc(int s, const ValueRef& ref) { setSrc(s, ref.get()); srcs[s].mod = ref.mod; }