+ static TestNativeImagePointer New(uint32_t width, uint32_t height);
+
+ inline void SetGlExtensionCreateResult(bool result)
+ {
+ createResult = result;
+ }
+ inline virtual bool CreateResource()
+ {
+ ++mExtensionCreateCalls;
+ mCallStack.PushCall("CreateResource", "");
+ return createResult;
+ };
+ inline virtual void DestroyResource()
+ {
+ ++mExtensionDestroyCalls;
+ mCallStack.PushCall("DestroyResource", "");
+ };
+ inline virtual GLenum TargetTexture()
+ {
+ ++mTargetTextureCalls;
+ mCallStack.PushCall("TargetTexture", "");
+ return mTargetTextureError--;
+ };
+ inline virtual void PrepareTexture()
+ {
+ mCallStack.PushCall("PrepareTexture", "");
+ };
+ inline virtual uint32_t GetWidth() const
+ {
+ mCallStack.PushCall("GetWidth", "");
+ return mWidth;
+ };
+ inline virtual uint32_t GetHeight() const
+ {
+ mCallStack.PushCall("GetHeight", "");
+ return mHeight;
+ };
+ inline virtual bool RequiresBlending() const
+ {
+ mCallStack.PushCall("RequiresBlending", "");
+ return true;
+ };
+ inline virtual int GetTextureTarget() const
+ {
+ mCallStack.PushCall("GetTextureTarget", "");
+ return GL_TEXTURE_EXTERNAL_OES;
+ };
+ inline virtual bool ApplyNativeFragmentShader(std::string& shader)
+ {
+ mCallStack.PushCall("ApplyNativeFragmentShader", "");
+ shader = "#extension GL_OES_EGL_image_external:require\n" + shader;
+
+ //Get custom sampler type name
+ const char* customSamplerTypename = GetCustomSamplerTypename();
+ if(customSamplerTypename)
+ {
+ size_t samplerPosition = shader.find("sampler2D");
+ if(samplerPosition != std::string::npos)
+ {
+ shader.replace(samplerPosition, strlen("sampler2D"), customSamplerTypename);
+ }
+ }
+ return true;
+ };
+ inline const char* GetCustomSamplerTypename() const override
+ {
+ mCallStack.PushCall("GetCustomSamplerTypename", "");
+ return "samplerExternalOES";
+ };