NetChat::NetChat(const Desc& desc): NetModelRPC<NetChat>(desc), testInt(0) { _i = this; RegRPC(&NetChat::OnPushLine); RegRPC(&NetChat::OnClear); syncState(ssDelta); }
TVerdict CSyncTestStep::doTestStepPreambleL() { __UHEAP_MARK; iScheduler = new(ELeave) CActiveScheduler; CActiveScheduler::Install(iScheduler); iSecureBackupEngine = CSBEClient::NewL(); // // Connect to PhBkSync... // TInt ret = iSession.Connect(); TESTCHECKL(ret, KErrNone); // // Perform a sync to start the tests in a clean state. We also wait for the // slower TSYs to get ready! // RPhoneBookSession::TSyncState syncState(RPhoneBookSession::EUnsynchronised); ret = iSession.GetPhoneBookCacheState(syncState); if (ret != KErrNone || syncState != RPhoneBookSession::ECacheValid) { TRequestStatus status(KErrUnknown); while (status.Int() != KErrNone) { iSession.DoSynchronisation(status); User::WaitForRequest(status); if (status.Int() == KErrServerTerminated) { INFO_PRINTF1(_L("PhBkSync has terminated, restarting...")); iSession.Close(); ret = iSession.Connect(); TESTCHECKL(ret, KErrNone); User::After(5*1000000); } else if (status.Int() != KErrNone) { INFO_PRINTF2(_L("Preamble sync result was %d so retrying..."), status.Int()); User::After(5*1000000); } } TESTCHECKL(status.Int(), KErrNone); // // For MMTSY testing to pass, ensure that the equivilant entries // from SIMTSY are on the SIM (slots 1 to 20 excluding 18 and 19)... // RArray<TInt> freeSlotArray; CleanupClosePushL(freeSlotArray); iSession.GetFreeSlotsL(freeSlotArray); for (TInt count = 1; count <= 20; count++) { if (freeSlotArray.Find(count) != KErrNotFound && count != 18 && count != 19) { TBuf<20> telName; TBuf<20> telNumber; telName.AppendFormat(_L("Friend %d"), count); telNumber.AppendFormat(_L("12345000%03d"), count); INFO_PRINTF4(_L("Preamble filling contact {\"%S\", \"%S\"} to slot %d..."), &telName, &telNumber, count); TContactICCEntry iccEntry; TRequestStatus status; iccEntry.iName.Copy(telName); iccEntry.iNumber.Copy(telNumber); iccEntry.iSlotNum = count; iccEntry.iContactUID = KNullContactId; iccEntry.iTON = RMobilePhone::EUnknownNumber; WriteContactToICCL(iccEntry, status); TESTCHECKL(status.Int(), KErrNone); TESTCHECKCONDITION(iccEntry.iSlotNum != KSyncIndexNotSupplied); } } CleanupStack::PopAndDestroy(&freeSlotArray); } return TestStepResult(); } // CSyncTestStep::doTestStepPreambleL
GLenum Framebuffer::checkStatus(const ContextState &data) const { // The default framebuffer *must* always be complete, though it may not be // subject to the same rules as application FBOs. ie, it could have 0x0 size. if (mId == 0) { return GL_FRAMEBUFFER_COMPLETE; } unsigned int colorbufferSize = 0; int samples = -1; bool missingAttachment = true; for (const FramebufferAttachment &colorAttachment : mState.mColorAttachments) { if (colorAttachment.isAttached()) { const Extents &size = colorAttachment.getSize(); if (size.width == 0 || size.height == 0) { return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } GLenum internalformat = colorAttachment.getInternalFormat(); const TextureCaps &formatCaps = data.textureCaps->get(internalformat); const InternalFormat &formatInfo = GetInternalFormatInfo(internalformat); if (colorAttachment.type() == GL_TEXTURE) { if (!formatCaps.renderable) { return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } if (formatInfo.depthBits > 0 || formatInfo.stencilBits > 0) { return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } if (colorAttachment.layer() >= size.depth) { return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } // ES3 specifies that cube map texture attachments must be cube complete. // This language is missing from the ES2 spec, but we enforce it here because some // desktop OpenGL drivers also enforce this validation. // TODO(jmadill): Check if OpenGL ES2 drivers enforce cube completeness. const Texture *texture = colorAttachment.getTexture(); ASSERT(texture); if (texture->getTarget() == GL_TEXTURE_CUBE_MAP && !texture->isCubeComplete()) { return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } } else if (colorAttachment.type() == GL_RENDERBUFFER) { if (!formatCaps.renderable || formatInfo.depthBits > 0 || formatInfo.stencilBits > 0) { return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } } if (!missingAttachment) { // APPLE_framebuffer_multisample, which EXT_draw_buffers refers to, requires that // all color attachments have the same number of samples for the FBO to be complete. if (colorAttachment.getSamples() != samples) { return GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT; } // in GLES 2.0, all color attachments attachments must have the same number of bitplanes // in GLES 3.0, there is no such restriction if (data.clientVersion < 3) { if (formatInfo.pixelBytes != colorbufferSize) { return GL_FRAMEBUFFER_UNSUPPORTED; } } } else { samples = colorAttachment.getSamples(); colorbufferSize = formatInfo.pixelBytes; missingAttachment = false; } } } const FramebufferAttachment &depthAttachment = mState.mDepthAttachment; if (depthAttachment.isAttached()) { const Extents &size = depthAttachment.getSize(); if (size.width == 0 || size.height == 0) { return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } GLenum internalformat = depthAttachment.getInternalFormat(); const TextureCaps &formatCaps = data.textureCaps->get(internalformat); const InternalFormat &formatInfo = GetInternalFormatInfo(internalformat); if (depthAttachment.type() == GL_TEXTURE) { // depth texture attachments require OES/ANGLE_depth_texture if (!data.extensions->depthTextures) { return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } if (!formatCaps.renderable) { return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } if (formatInfo.depthBits == 0) { return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } } else if (depthAttachment.type() == GL_RENDERBUFFER) { if (!formatCaps.renderable || formatInfo.depthBits == 0) { return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } } if (missingAttachment) { samples = depthAttachment.getSamples(); missingAttachment = false; } else if (samples != depthAttachment.getSamples()) { return GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE; } } const FramebufferAttachment &stencilAttachment = mState.mStencilAttachment; if (stencilAttachment.isAttached()) { const Extents &size = stencilAttachment.getSize(); if (size.width == 0 || size.height == 0) { return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } GLenum internalformat = stencilAttachment.getInternalFormat(); const TextureCaps &formatCaps = data.textureCaps->get(internalformat); const InternalFormat &formatInfo = GetInternalFormatInfo(internalformat); if (stencilAttachment.type() == GL_TEXTURE) { // texture stencil attachments come along as part // of OES_packed_depth_stencil + OES/ANGLE_depth_texture if (!data.extensions->depthTextures) { return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } if (!formatCaps.renderable) { return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } if (formatInfo.stencilBits == 0) { return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } } else if (stencilAttachment.type() == GL_RENDERBUFFER) { if (!formatCaps.renderable || formatInfo.stencilBits == 0) { return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } } if (missingAttachment) { samples = stencilAttachment.getSamples(); missingAttachment = false; } else if (samples != stencilAttachment.getSamples()) { return GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE; } // Starting from ES 3.0 stencil and depth, if present, should be the same image if (data.clientVersion >= 3 && depthAttachment.isAttached() && stencilAttachment != depthAttachment) { return GL_FRAMEBUFFER_UNSUPPORTED; } } // we need to have at least one attachment to be complete if (missingAttachment) { return GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT; } // In ES 2.0, all color attachments must have the same width and height. // In ES 3.0, there is no such restriction. if (data.clientVersion < 3 && !mState.attachmentsHaveSameDimensions()) { return GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS; } syncState(); if (!mImpl->checkStatus()) { return GL_FRAMEBUFFER_UNSUPPORTED; } return GL_FRAMEBUFFER_COMPLETE; }
void Framebuffer11::syncInternalState(const gl::Context *context) { syncState(context, gl::Framebuffer::DirtyBits()); }
void Framebuffer11::syncInternalState() { syncState(gl::Framebuffer::DirtyBits()); }
void MotorController::rightReleased() { mKeyState ^= RIGHT; syncState(); }
void MotorController::rightPressed() { mKeyState |= RIGHT; syncState(); }
void MotorController::leftReleased() { mKeyState ^= LEFT; syncState(); }
void MotorController::leftPressed() { mKeyState |= LEFT; syncState(); }
void MotorController::upReleased() { mKeyState ^= UP; syncState(); }
void MotorController::upPressed() { mKeyState |= UP; syncState(); }