Texture image filtering 11/24811/9
authorKingsley Stephens <k.stephens@partner.samsung.com>
Tue, 22 Jul 2014 13:06:42 +0000 (14:06 +0100)
committerKingsley Stephens <k.stephens@partner.samsung.com>
Fri, 25 Jul 2014 10:33:22 +0000 (03:33 -0700)
Add ability to set texture filtering modes per RenderableActor.

Change-Id: I1d0572a27cb75226b095a4cb31b21197539959d7

32 files changed:
automated-tests/src/dali-internal/utc-Dali-Internal-Material.cpp
automated-tests/src/dali/dali-test-suite-utils/test-gl-abstraction.h
automated-tests/src/dali/utc-Dali-RenderableActor.cpp
dali/internal/common/image-sampler.cpp [new file with mode: 0644]
dali/internal/common/image-sampler.h [new file with mode: 0644]
dali/internal/event/actor-attachments/renderable-attachment-impl.cpp
dali/internal/event/actor-attachments/renderable-attachment-impl.h
dali/internal/event/actors/renderable-actor-impl.cpp
dali/internal/event/actors/renderable-actor-impl.h
dali/internal/file.list
dali/internal/render/gl-resources/bitmap-texture.cpp
dali/internal/render/gl-resources/compressed-bitmap-texture.cpp
dali/internal/render/gl-resources/frame-buffer-texture.cpp
dali/internal/render/gl-resources/native-frame-buffer-texture.cpp
dali/internal/render/gl-resources/native-texture.cpp
dali/internal/render/gl-resources/texture.cpp
dali/internal/render/gl-resources/texture.h
dali/internal/render/renderers/render-material.cpp
dali/internal/render/renderers/render-material.h
dali/internal/render/renderers/scene-graph-image-renderer.cpp
dali/internal/render/renderers/scene-graph-mesh-renderer.cpp
dali/internal/render/renderers/scene-graph-renderer.cpp
dali/internal/render/renderers/scene-graph-renderer.h
dali/internal/render/renderers/scene-graph-text-renderer.cpp
dali/internal/render/shaders/shader.cpp
dali/internal/update/node-attachments/scene-graph-renderable-attachment.cpp
dali/internal/update/node-attachments/scene-graph-renderable-attachment.h
dali/public-api/actors/renderable-actor.cpp
dali/public-api/actors/renderable-actor.h
dali/public-api/actors/sampling.h [new file with mode: 0644]
dali/public-api/dali-core.h
dali/public-api/file.list

index 0c49524..920dc65 100644 (file)
@@ -41,6 +41,7 @@ using namespace Dali;
 #include <dali/internal/render/renderers/render-material.h>
 #include <dali/internal/render/gl-resources/context.h>
 #include <dali/internal/render/shaders/program.h>
+#include <dali/internal/common/image-sampler.h>
 
 namespace
 {
@@ -386,7 +387,7 @@ int UtcDaliMaterialStaging01(void)
   application.Render(); //Process render Q stores & processes mat
 
   renderMaterial->SetUniforms( materialUniforms, testProgram.GetProgram(), Internal::SHADER_DEFAULT );
-  renderMaterial->BindTextures( testProgram.GetProgram() );
+  renderMaterial->BindTextures( testProgram.GetProgram(), Internal::ImageSampler::DefaultOptions() );
   DALI_TEST_CHECK( boundTextures.GetNumBoundTextures() == 0 );
 
   DALI_TEST_EQUALS( testProgram.GetOpacity(),       TEST_PROPS.mOpacity,       TEST_LOCATION);
@@ -440,7 +441,7 @@ int UtcDaliMaterialStaging02(void)
   application.Render(); //Process render Q stores & processes mat
 
   renderMaterial->SetUniforms( materialUniforms, testProgram.GetProgram(), Internal::SHADER_DEFAULT );
-  renderMaterial->BindTextures( testProgram.GetProgram() );
+  renderMaterial->BindTextures( testProgram.GetProgram(), Internal::ImageSampler::DefaultOptions() );
 
   DALI_TEST_CHECK( boundTextures.GetNumBoundTextures() == 0 );
   DALI_TEST_EQUALS( testProgram.GetOpacity(),       0.4f, TEST_LOCATION);
@@ -483,7 +484,7 @@ int UtcDaliMaterialSetPropsWhilstStaged(void)
 
   Internal::SceneGraph::RenderMaterialUniforms materialUniforms;
   renderMaterial->SetUniforms( materialUniforms, testProgram.GetProgram(), Internal::SHADER_DEFAULT );
-  renderMaterial->BindTextures( testProgram.GetProgram() );
+  renderMaterial->BindTextures( testProgram.GetProgram(), Internal::ImageSampler::DefaultOptions() );
 
   DALI_TEST_EQUALS( boundTextures.GetNumBoundTextures(), 0u, TEST_LOCATION );
 
@@ -525,7 +526,7 @@ int UtcDaliMaterialSetTextureWhilstStaged(void)
   application.Render(); // Update & Prepare material
   application.Render(); // Process render Q
 
-  renderMaterial->BindTextures( testProgram.GetProgram() );
+  renderMaterial->BindTextures( testProgram.GetProgram(), Internal::ImageSampler::DefaultOptions() );
   DALI_TEST_CHECK( boundTextures.CheckFirstTextureBound( GL_TEXTURE0 ) );
   END_TEST;
 }
@@ -565,7 +566,7 @@ int UtcDaliMaterialSetUnreadyTextureWhilstStaged(void)
   application.Render(); // Update & Prepare material
   application.Render(); // Process render Q
 
-  renderMaterial->BindTextures( testProgram.GetProgram() );
+  renderMaterial->BindTextures( testProgram.GetProgram(), Internal::ImageSampler::DefaultOptions() );
 
   DALI_TEST_EQUALS( boundTextures.GetNumBoundTextures(), 0u, TEST_LOCATION );
 
@@ -577,7 +578,7 @@ int UtcDaliMaterialSetUnreadyTextureWhilstStaged(void)
   application.Render();           // Process LoadComplete
   application.SendNotification(); // Process event messages
 
-  renderMaterial->BindTextures( testProgram.GetProgram() );
+  renderMaterial->BindTextures( testProgram.GetProgram(), Internal::ImageSampler::DefaultOptions() );
   DALI_TEST_CHECK( boundTextures.CheckFirstTextureBound( GL_TEXTURE0 ) );
   END_TEST;
 }
index 7d203c1..13705f7 100644 (file)
@@ -794,18 +794,30 @@ public:
 
   inline void TexParameterf(GLenum target, GLenum pname, GLfloat param)
   {
+    std::stringstream out;
+    out << target << ", " << pname << ", " << param;
+    mTexParamaterTrace.PushCall("TexParameterf", out.str());
   }
 
   inline void TexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
   {
+    std::stringstream out;
+    out << target << ", " << pname << ", " << params[0];
+    mTexParamaterTrace.PushCall("TexParameterfv", out.str());
   }
 
   inline void TexParameteri(GLenum target, GLenum pname, GLint param)
   {
+    std::stringstream out;
+    out << target << ", " << pname << ", " << param;
+    mTexParamaterTrace.PushCall("TexParameteri", out.str());
   }
 
   inline void TexParameteriv(GLenum target, GLenum pname, const GLint* params)
   {
+    std::stringstream out;
+    out << target << ", " << pname << ", " << params[0];
+    mTexParamaterTrace.PushCall("TexParameteriv", out.str());
   }
 
   inline void TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels)
@@ -1513,6 +1525,11 @@ public: // TEST FUNCTIONS
   inline void ResetTextureCallStack() { mTextureTrace.Reset(); }
   inline TraceCallStack& GetTextureTrace() { return mTextureTrace; }
 
+  //Methods for Texture verification
+  inline void EnableTexParameterCallTrace(bool enable) { mTexParamaterTrace.Enable(enable); }
+  inline void ResetTexParameterCallStack() { mTexParamaterTrace.Reset(); }
+  inline TraceCallStack& GetTexParameterTrace() { return mTexParamaterTrace; }
+
   //Methods for Draw verification
   inline void EnableDrawCallTrace(bool enable) { mDrawTrace.Enable(enable); }
   inline void ResetDrawCallStack() { mDrawTrace.Reset(); }
@@ -1670,6 +1687,7 @@ private:
   TraceCallStack mCullFaceTrace;
   TraceCallStack mShaderTrace;
   TraceCallStack mTextureTrace;
+  TraceCallStack mTexParamaterTrace;
   TraceCallStack mDrawTrace;
 
   // Shaders & Uniforms
index 0699654..ee3075b 100644 (file)
@@ -502,3 +502,178 @@ int UtcDaliRenderableActorCreateDestroy(void)
   delete ractor;
   END_TEST;
 }
+
+int UtcDaliRenderableActorSetGetFilterModes(void)
+{
+  TestApplication application;
+
+  tet_infoline("Testing Dali::RenderableActor::SetFilterMode() / Dali::RenderableActor::GetFilterMode()");
+
+  TextActor actor = TextActor::New(TestTextHelloWorld);
+
+  FilterMode::Type minifyFilter = FilterMode::NEAREST;
+  FilterMode::Type magnifyFilter = FilterMode::NEAREST;
+
+  // Default test
+  actor.GetFilterMode( minifyFilter, magnifyFilter );
+  DALI_TEST_CHECK( FilterMode::DEFAULT == minifyFilter );
+  DALI_TEST_CHECK( FilterMode::DEFAULT == magnifyFilter );
+
+  // Default/Default
+  actor.SetFilterMode( FilterMode::DEFAULT, FilterMode::DEFAULT );
+  actor.GetFilterMode( minifyFilter, magnifyFilter );
+  DALI_TEST_CHECK( FilterMode::DEFAULT == minifyFilter );
+  DALI_TEST_CHECK( FilterMode::DEFAULT == magnifyFilter );
+
+  // Nearest/Nearest
+  actor.SetFilterMode( FilterMode::NEAREST, FilterMode::NEAREST );
+  actor.GetFilterMode( minifyFilter, magnifyFilter );
+  DALI_TEST_CHECK( FilterMode::NEAREST == minifyFilter );
+  DALI_TEST_CHECK( FilterMode::NEAREST == magnifyFilter );
+
+  // Linear/Linear
+  actor.SetFilterMode( FilterMode::LINEAR, FilterMode::LINEAR );
+  actor.GetFilterMode( minifyFilter, magnifyFilter );
+  DALI_TEST_CHECK( FilterMode::LINEAR == minifyFilter );
+  DALI_TEST_CHECK( FilterMode::LINEAR == magnifyFilter );
+
+  // Nearest/Linear
+  actor.SetFilterMode( FilterMode::NEAREST, FilterMode::LINEAR );
+  actor.GetFilterMode( minifyFilter, magnifyFilter );
+  DALI_TEST_CHECK( FilterMode::NEAREST == minifyFilter );
+  DALI_TEST_CHECK( FilterMode::LINEAR == magnifyFilter );
+
+  // Linear/Nearest
+  actor.SetFilterMode( FilterMode::LINEAR, FilterMode::NEAREST );
+  actor.GetFilterMode( minifyFilter, magnifyFilter );
+  DALI_TEST_CHECK( FilterMode::LINEAR == minifyFilter );
+  DALI_TEST_CHECK( FilterMode::NEAREST == magnifyFilter );
+
+  END_TEST;
+}
+
+int UtcDaliRenderableActorSetFilterMode(void)
+{
+  TestApplication application;
+
+  tet_infoline("Testing Dali::RenderableActor::SetFilterMode()");
+
+  BitmapImage img = BitmapImage::New( 1,1 );
+  ImageActor actor = ImageActor::New( img );
+
+  actor.SetSize(100.0f, 100.0f);
+  actor.SetParentOrigin(ParentOrigin::CENTER);
+  actor.SetAnchorPoint(AnchorPoint::CENTER);
+
+  Stage::GetCurrent().Add(actor);
+
+  /**************************************************************/
+
+  // Default/Default
+  TraceCallStack& texParameterTrace = application.GetGlAbstraction().GetTexParameterTrace();
+  texParameterTrace.Reset();
+  texParameterTrace.Enable( true );
+
+  actor.SetFilterMode( FilterMode::DEFAULT, FilterMode::DEFAULT );
+
+  // Flush the queue and render once
+  application.SendNotification();
+  application.Render();
+
+  texParameterTrace.Enable( false );
+
+  std::stringstream out;
+
+  // Verify actor gl state
+
+  // The first one should be true as we don't want to use the GL default
+  // The second one should be false as we want to use the GL default, therefore the TexParameter function should not be called
+  // There are two calls to TexParameteri when the texture is first created
+  DALI_TEST_EQUALS( texParameterTrace.CountMethod( "TexParameteri" ), 3, TEST_LOCATION);
+
+  out.str("");
+  out << GL_TEXTURE_2D << ", " << GL_TEXTURE_MIN_FILTER << ", " << GL_LINEAR;
+  DALI_TEST_EQUALS( texParameterTrace.TestMethodAndParams(2, "TexParameteri", out.str()), true, TEST_LOCATION);
+
+  /**************************************************************/
+
+  // Nearest/Nearest
+  texParameterTrace.Reset();
+  texParameterTrace.Enable( true );
+
+  actor.SetFilterMode( FilterMode::NEAREST, FilterMode::NEAREST );
+
+  // Flush the queue and render once
+  application.SendNotification();
+  application.Render();
+
+  texParameterTrace.Enable( false );
+
+  // Verify actor gl state
+  DALI_TEST_EQUALS( texParameterTrace.CountMethod( "TexParameteri" ), 2, TEST_LOCATION);
+
+  out.str("");
+  out << GL_TEXTURE_2D << ", " << GL_TEXTURE_MIN_FILTER << ", " << GL_NEAREST;
+  DALI_TEST_EQUALS( texParameterTrace.TestMethodAndParams(0, "TexParameteri", out.str()), true, TEST_LOCATION);
+
+  out.str("");
+  out << GL_TEXTURE_2D << ", " << GL_TEXTURE_MAG_FILTER << ", " << GL_NEAREST;
+  DALI_TEST_EQUALS( texParameterTrace.TestMethodAndParams(1, "TexParameteri", out.str()), true, TEST_LOCATION);
+
+  /**************************************************************/
+
+  // Linear/Linear
+  texParameterTrace.Reset();
+  texParameterTrace.Enable( true );
+
+  actor.SetFilterMode( FilterMode::LINEAR, FilterMode::LINEAR );
+
+  // Flush the queue and render once
+  application.SendNotification();
+  application.Render();
+
+  texParameterTrace.Enable( false );
+
+  // Verify actor gl state
+  DALI_TEST_EQUALS( texParameterTrace.CountMethod( "TexParameteri" ), 2, TEST_LOCATION);
+
+  out.str("");
+  out << GL_TEXTURE_2D << ", " << GL_TEXTURE_MIN_FILTER << ", " << GL_LINEAR;
+  DALI_TEST_EQUALS( texParameterTrace.TestMethodAndParams(0, "TexParameteri", out.str()), true, TEST_LOCATION);
+
+  out.str("");
+  out << GL_TEXTURE_2D << ", " << GL_TEXTURE_MAG_FILTER << ", " << GL_LINEAR;
+  DALI_TEST_EQUALS( texParameterTrace.TestMethodAndParams(1, "TexParameteri", out.str()), true, TEST_LOCATION);
+
+
+  /**************************************************************/
+
+  // Nearest/Linear
+  texParameterTrace.Reset();
+  texParameterTrace.Enable( true );
+
+  actor.SetFilterMode( FilterMode::NEAREST, FilterMode::LINEAR );
+
+  // Flush the queue and render once
+  application.SendNotification();
+  application.Render();
+
+  texParameterTrace.Enable( false );
+
+  // Verify actor gl state
+  DALI_TEST_EQUALS( texParameterTrace.CountMethod( "TexParameteri" ), 2, TEST_LOCATION);
+
+  out.str("");
+  out << GL_TEXTURE_2D << ", " << GL_TEXTURE_MIN_FILTER << ", " << GL_NEAREST;
+  DALI_TEST_EQUALS( texParameterTrace.TestMethodAndParams(0, "TexParameteri", out.str()), true, TEST_LOCATION);
+
+  out.str("");
+  out << GL_TEXTURE_2D << ", " << GL_TEXTURE_MAG_FILTER << ", " << GL_LINEAR;
+  DALI_TEST_EQUALS( texParameterTrace.TestMethodAndParams(1, "TexParameteri", out.str()), true, TEST_LOCATION);
+
+  /**************************************************************/
+
+  Stage::GetCurrent().Remove(actor);
+
+  END_TEST;
+}
diff --git a/dali/internal/common/image-sampler.cpp b/dali/internal/common/image-sampler.cpp
new file mode 100644 (file)
index 0000000..549f4bf
--- /dev/null
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/common/image-sampler.h>
+
+#include <iostream>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace ImageSampler
+{
+
+namespace
+{
+
+// Adjust these shift sizes if the FilterMode enum grows
+const int MINIFY_BIT_SHIFT  = 0;    // Room for 16
+const int MAGNIFY_BIT_SHIFT = 4;
+
+const int MASK_MINIFY_FILTER    = 0x0000000F;
+const int MASK_MAGNIFY_FILTER   = 0x000000F0;
+
+const unsigned int FILTER_MODE_COUNT = 3;
+
+FilterMode::Type FILTER_MODE_OPTIONS[ FILTER_MODE_COUNT ] =
+  { FilterMode::DEFAULT,
+    FilterMode::NEAREST,
+    FilterMode::LINEAR };
+
+// These are the default sampling options - must match what is in GL
+const FilterMode::Type DEFAULT_MINIFY = FilterMode::LINEAR;
+const FilterMode::Type DEFAULT_MAGNIFY = FilterMode::LINEAR;
+
+} // namespace
+
+/**
+ * Utility to store one of the FilterMode values.
+ * @param[out] options A bitmask used to store the FilterMode values.
+ * @param[in] factor The FilterMode value.
+ * @param[in] bitshift Used to shift to the correct part of options.
+ */
+void StoreFilterMode( unsigned int& options, FilterMode::Type mode, int bitShift )
+{
+  // Start shifting from 1 as 0 is the unassigned state
+  switch ( mode )
+  {
+    case FilterMode::DEFAULT:
+    {
+      options |= ( 1u << bitShift );
+      break;
+    }
+    case FilterMode::NEAREST:
+    {
+      options |= ( 2u << bitShift );
+      break;
+    }
+    case FilterMode::LINEAR:
+    {
+      options |= ( 3u << bitShift );
+      break;
+    }
+  }
+}
+
+/**
+ * Utility to retrieve one of the FilterMode values.
+ * @param[in] options A bitmask of filter values.
+ * @param[in] mask The used to mask unwanted values.
+ * @param[in] bitshift Used to shift to the correct part of options.
+ * @return The filter mode.
+ */
+bool RetrieveFilterMode( unsigned int options, int mask, int bitShift, FilterMode::Type& filterModeOut )
+{
+  unsigned int index = options & mask;
+
+  if( index != 0 )
+  {
+    index = ( index >> bitShift ) - 1;    // Zero based index for array
+
+    DALI_ASSERT_DEBUG( index < FILTER_MODE_COUNT );
+
+    filterModeOut = FILTER_MODE_OPTIONS[ index ];
+    return true;
+  }
+
+  return false;
+}
+
+unsigned int DefaultOptions()
+{
+  // Only initialise min filter as mag filter will use the system default
+  unsigned int bitfield = 0;
+  StoreFilterMode( bitfield, DEFAULT_MINIFY, MINIFY_BIT_SHIFT );
+  return bitfield;
+}
+
+bool IsMinifyAssigned( unsigned int bitfield )
+{
+  FilterMode::Type filterModeDummy = FilterMode::NEAREST;
+  return RetrieveFilterMode( bitfield, MASK_MINIFY_FILTER, MINIFY_BIT_SHIFT, filterModeDummy );
+}
+
+bool IsMagnifyAssigned( unsigned int bitfield )
+{
+  FilterMode::Type filterModeDummy = FilterMode::NEAREST;
+  return RetrieveFilterMode( bitfield, MASK_MAGNIFY_FILTER, MAGNIFY_BIT_SHIFT, filterModeDummy );
+}
+
+unsigned int PackBitfield( FilterMode::Type minify, FilterMode::Type magnify )
+{
+  unsigned int bitfield = 0;
+  StoreFilterMode( bitfield, minify, MINIFY_BIT_SHIFT );
+  StoreFilterMode( bitfield, magnify, MAGNIFY_BIT_SHIFT );
+  return bitfield;
+}
+
+FilterMode::Type GetMinifyFilterMode( unsigned int bitfield )
+{
+  FilterMode::Type filterMode = FilterMode::NEAREST;
+  RetrieveFilterMode( bitfield, MASK_MINIFY_FILTER, MINIFY_BIT_SHIFT, filterMode );
+  return filterMode;
+}
+
+FilterMode::Type GetMagnifyFilterMode( unsigned int bitfield )
+{
+  FilterMode::Type filterMode = FilterMode::NEAREST;
+  RetrieveFilterMode( bitfield, MASK_MAGNIFY_FILTER, MAGNIFY_BIT_SHIFT, filterMode );
+  return filterMode;
+}
+
+} // namespace ImageSampler
+
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali/internal/common/image-sampler.h b/dali/internal/common/image-sampler.h
new file mode 100644 (file)
index 0000000..2491b78
--- /dev/null
@@ -0,0 +1,92 @@
+#ifndef __DALI_IMAGE_SAMPLER_H__
+#define __DALI_IMAGE_SAMPLER_H__
+
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/actors/sampling.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+/**
+ * ImageSampler represents a set of sampling settings that can be applied to a texture.
+ */
+namespace ImageSampler
+{
+
+  /**
+   * Determine if the minify component of the bitfield is assigned.
+   *
+   * @param[in] bitfield The packed sampler bitfield pattern.
+   * @return Return if the minify component is assigned or not.
+   */
+  bool IsMinifyAssigned( unsigned int bitfield );
+
+  /**
+   * Determine if the magnify component of the bitfield is assigned.
+   *
+   * @param[in] bitfield The packed sampler bitfield pattern.
+   * @return Return if the magnify component is assigned or not.
+   */
+  bool IsMagnifyAssigned( unsigned int bitfield );
+
+  /**
+   * @brief Return a sampler bitfield with default settings.
+   *
+   * @return Return the default sampler bit pattern.
+   */
+  unsigned int DefaultOptions();
+
+  /**
+   * @brief Pack the filter mode into a bitfield.
+   *
+   * @param[in] minify The minification filter.
+   * @param[in] magnify The magnification filter.
+   * @return Return the packed bitfield.
+   */
+   unsigned int PackBitfield( FilterMode::Type minify, FilterMode::Type magnify );
+
+   /**
+   * @brief Return the minification filter from a packed bitfield.
+   *
+   * @return Return the minification filter.
+   */
+   FilterMode::Type GetMinifyFilterMode( unsigned int bitfield );
+
+   /**
+   * @brief Return the magnification filter from a packed bitfield.
+   *
+   * @return Return the magnification filter.
+   */
+   FilterMode::Type GetMagnifyFilterMode( unsigned int bitfield );
+
+} // namespace ImageSampler
+
+} // namespace Internal
+
+} // namespace Dali
+
+
+#endif // __DALI_INTERNAL_IMAGE_SAMPLER_H__
+
+
+
index be610b4..84d4d71 100644 (file)
@@ -33,7 +33,8 @@ RenderableAttachment::RenderableAttachment( Stage& stage )
 : ActorAttachment( stage ),
   mSortModifier( 0.0f ),
   mCullFaceMode( CullNone ),
-  mBlendingMode( BlendingMode::AUTO )
+  mBlendingMode( BlendingMode::AUTO ),
+  mSamplerBitfield( ImageSampler::PackBitfield( FilterMode::DEFAULT, FilterMode::DEFAULT ) )
 {
 }
 
@@ -139,6 +140,20 @@ const Vector4& RenderableAttachment::GetBlendColor() const
   return Vector4::ZERO;
 }
 
+void RenderableAttachment::SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter )
+{
+  mSamplerBitfield = ImageSampler::PackBitfield( minFilter, magFilter );
+
+  SetSamplerMessage( mStage->GetUpdateInterface(), GetSceneObject(), mSamplerBitfield );
+}
+
+void RenderableAttachment::GetFilterMode( FilterMode::Type& minFilter, FilterMode::Type& magFilter ) const
+{
+  minFilter = ImageSampler::GetMinifyFilterMode( mSamplerBitfield );
+  magFilter = ImageSampler::GetMagnifyFilterMode( mSamplerBitfield );
+}
+
+
 void RenderableAttachment::OnStageConnection()
 {
   // For derived classes
index 5d034b9..5900e71 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/public-api/actors/renderable-actor.h>
 #include <dali/public-api/actors/blending.h>
 #include <dali/internal/common/blending-options.h>
+#include <dali/internal/common/image-sampler.h>
 #include <dali/internal/event/actor-attachments/actor-attachment-impl.h>
 
 namespace Dali
@@ -110,6 +111,16 @@ public:
    */
   const Vector4& GetBlendColor() const;
 
+  /**
+   * @copydoc Dali::RenderableActor::SetFilterMode()
+   */
+  void SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter );
+
+  /**
+   * @copydoc Dali::RenderableActor::GetFilterMode()
+   */
+  void GetFilterMode( FilterMode::Type& minFilter, FilterMode::Type& magFilter ) const;
+
 protected:
 
   /**
@@ -170,6 +181,7 @@ private:
   CullFaceMode       mCullFaceMode;
   BlendingMode::Type mBlendingMode;
   BlendingOptions    mBlendingOptions;
+  unsigned int       mSamplerBitfield;
 };
 
 } // namespace Internal
index 3093142..82ca81a 100644 (file)
@@ -119,6 +119,16 @@ const Vector4& RenderableActor::GetBlendColor() const
   return GetRenderableAttachment().GetBlendColor();
 }
 
+void RenderableActor::SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter )
+{
+  GetRenderableAttachment().SetFilterMode( minFilter, magFilter );
+}
+
+void RenderableActor::GetFilterMode( FilterMode::Type& minFilter, FilterMode::Type& magFilter ) const
+{
+  return GetRenderableAttachment().GetFilterMode( minFilter, magFilter );
+}
+
 RenderableActor::RenderableActor()
 : Actor( Actor::RENDERABLE )
 {
index 6335573..8cfc9fb 100644 (file)
@@ -110,6 +110,16 @@ public:
    */
   const Vector4& GetBlendColor() const;
 
+  /**
+   * @copydoc Dali::RenderableActor::SetFilterMode()
+   */
+  void SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter );
+
+  /**
+   * @copydoc Dali::RenderableActor::GetFilterMode()
+   */
+  void GetFilterMode( FilterMode::Type& minFilter, FilterMode::Type& magFilter ) const;
+
 protected:
 
   /**
index 256a14d..e0f0775 100644 (file)
@@ -7,6 +7,7 @@ internal_src_files = \
   $(internal_src_dir)/common/internal-constants.cpp \
   $(internal_src_dir)/common/message-buffer.cpp \
   $(internal_src_dir)/common/text-parameters.cpp \
+  $(internal_src_dir)/common/image-sampler.cpp \
   \
   $(internal_src_dir)/event/actor-attachments/actor-attachment-impl.cpp \
   $(internal_src_dir)/event/actor-attachments/camera-attachment-impl.cpp \
index 8b2b013..0900dc6 100644 (file)
@@ -219,8 +219,6 @@ void BitmapTexture::AssignBitmap( bool generateTexture, const unsigned char* pix
 
   mContext.PixelStorei(GL_UNPACK_ALIGNMENT, 1); // We always use tightly packed data
   mContext.TexImage2D(GL_TEXTURE_2D, 0, pixelFormat, mWidth, mHeight, 0, pixelFormat, pixelDataType, pixels);
-  mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-  mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
   mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
   mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 
index 2e3e257..7642833 100644 (file)
@@ -94,8 +94,6 @@ void CompressedBitmapTexture::AssignBitmap( bool generateTexture, const unsigned
 
   mContext.PixelStorei(GL_UNPACK_ALIGNMENT, 1); // We always use tightly packed data
   mContext.CompressedTexImage2D(GL_TEXTURE_2D, 0, pixelFormat, mWidth, mHeight, 0, bufferSize, pixels);
-  mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-  mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
   mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
   mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 
index aa0a81f..d25ceed 100644 (file)
@@ -103,8 +103,6 @@ bool FrameBufferTexture::CreateGlTexture()
 
   // set texture parameters
   mContext.PixelStorei(GL_UNPACK_ALIGNMENT, 1);
-  mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-  mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
   mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
   mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 
index 54102c4..2a6bd75 100644 (file)
@@ -81,8 +81,6 @@ bool NativeFrameBufferTexture::CreateGlTexture()
 
     mContext.PixelStorei(GL_UNPACK_ALIGNMENT, 1); // We always use tightly packed data
 
-    mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-    mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
     mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
     mContext.TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 
index ab3288a..1c3f93a 100644 (file)
@@ -100,8 +100,6 @@ bool NativeTexture::CreateGlTexture()
 
     mContext.PixelStorei( GL_UNPACK_ALIGNMENT, 1 ); // We always use tightly packed data
 
-    mContext.TexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
-    mContext.TexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
     mContext.TexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
     mContext.TexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
 
index 1ae4d7f..fb20c30 100644 (file)
@@ -26,6 +26,7 @@
 #include <dali/integration-api/debug.h>
 #include <dali/internal/render/common/vertex.h>
 #include <dali/internal/render/gl-resources/context.h>
+#include <dali/internal/common/image-sampler.h>
 
 namespace Dali
 {
@@ -33,6 +34,33 @@ namespace Dali
 namespace Internal
 {
 
+/**
+ * Convert a FilterMode to it's corresponding GL type.
+ *
+ * @param[in] filterMode The FilterMode type.
+ * @return Return the equivalent GL type.
+ */
+GLint FilterModeToGL( FilterMode::Type filterMode )
+{
+  switch( filterMode )
+  {
+    case FilterMode::NEAREST:
+    {
+      return GL_NEAREST;
+    }
+    case FilterMode::LINEAR:
+    {
+      return GL_LINEAR;
+    }
+    case FilterMode::DEFAULT:
+    {
+      // Do nothing
+    }
+  }
+
+  return GL_LINEAR;
+}
+
 using Dali::Internal::Vertex2D;
 using Dali::Internal::Vertex3D;
 
@@ -46,6 +74,7 @@ Texture::Texture(Context&      context,
                  Pixel::Format pixelFormat)
 : mContext(context),
   mId(0),
+  mSamplerBitfield( 0 ),
   mWidth(width),
   mHeight(height),
   mImageWidth(imageWidth),
@@ -212,6 +241,37 @@ void Texture::GetDefaultTextureCoordinates(UvRect& uv) const
 
 }
 
+void Texture::ApplySampler( unsigned int samplerBitfield )
+{
+  if( mSamplerBitfield != samplerBitfield )
+  {
+    // Only set the tex parameters if they have been set in the sampler bitfield
+    FilterMode::Type filterMode = ImageSampler::GetMinifyFilterMode( samplerBitfield );
+    if( filterMode != FilterMode::DEFAULT )
+    {
+      mContext.TexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, FilterModeToGL( filterMode ) );
+    }
+    else  // We don't want to use the GL default
+    {
+      // Reset to system default option
+      mContext.TexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, FilterModeToGL( ImageSampler::GetMinifyFilterMode( ImageSampler::DefaultOptions() ) ) );
+    }
+
+    filterMode = ImageSampler::GetMagnifyFilterMode( samplerBitfield );
+    if( filterMode != FilterMode::DEFAULT )
+    {
+      mContext.TexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, FilterModeToGL( filterMode ) );
+    }
+    else if( ImageSampler::IsMagnifyAssigned( mSamplerBitfield ) )   // We want to use the GL default
+    {
+      // Reset to system default option
+      mContext.TexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, FilterModeToGL( ImageSampler::GetMagnifyFilterMode( ImageSampler::DefaultOptions() ) ) );
+    }
+
+    mSamplerBitfield = samplerBitfield;
+  }
+}
+
 } // namespace Internal
 
 } // namespace Dali
index e30a6d3..42510c8 100644 (file)
@@ -169,6 +169,13 @@ public:
    */
   void GetTextureCoordinates(UvRect& uv, const PixelArea* pixelArea = NULL);
 
+  /**
+   * @brief Apply the given sampler to the texture.
+   *
+   * @param[in] samplerBitfield A bitfield with packed sampler options.
+   */
+  void ApplySampler( unsigned int samplerBitfield );
+
 protected:
 
   /**
@@ -246,6 +253,8 @@ protected:
 
   GLuint        mId;           ///< Texture id
 
+  unsigned int  mSamplerBitfield;    ///< The packed bitfield of the current sampler
+
   unsigned int  mWidth;        ///< texture width, may be scaled power of 2 (if not in an atlas)
   unsigned int  mHeight;       ///< texture width, may be scaled power of 2 (if not in an atlas)
 
index 4492dbb..bbdebd5 100644 (file)
@@ -253,7 +253,7 @@ void RenderMaterial::BindTexture( Program& program, ResourceId id, Texture* text
   }
 }
 
-void RenderMaterial::BindTextures( Program& program )
+void RenderMaterial::BindTextures( Program& program, unsigned int textureSampler )
 {
   DALI_ASSERT_DEBUG( NULL != mTextureCache );
 
@@ -281,10 +281,27 @@ void RenderMaterial::BindTextures( Program& program )
     }
   }
 
-  BindTexture( program, mDiffuseTextureId,mDiffuseTexture, 0, Program::UNIFORM_SAMPLER );
+  BindTexture( program, mDiffuseTextureId, mDiffuseTexture, 0, Program::UNIFORM_SAMPLER );
+
+  if( mDiffuseTexture )
+  {
+    mDiffuseTexture->ApplySampler( textureSampler );
+  }
+
   // GL_TEXTURE1 is used by shader effect texture
   BindTexture( program, mOpacityTextureId, mOpacityTexture, 2, Program::UNIFORM_SAMPLER_OPACITY );
+
+  if( mOpacityTexture )
+  {
+    mOpacityTexture->ApplySampler( textureSampler );
+  }
+
   BindTexture( program, mNormalMapTextureId, mNormalMapTexture, 3, Program::UNIFORM_SAMPLER_NORMAL_MAP );
+
+  if( mNormalMapTexture )
+  {
+    mNormalMapTexture->ApplySampler( textureSampler );
+  }
 }
 
 void RenderMaterial::TextureDiscarded( unsigned int textureId )
index 3e58869..8496912 100644 (file)
@@ -164,8 +164,9 @@ public:
   /**
    * Bind all the valid textures. Will also store valid texture pointer
    * @param[in] program The shader program with which to bind the textures
+   * @param[in] textureSampler The texture sampling parameters for the diffuse, opacity and normal textures
    */
-  void BindTextures( Program& program );
+  void BindTextures( Program& program, unsigned int textureSampler );
 
 protected: // TextureObserver implementation
   /**
index e046530..370aa92 100644 (file)
@@ -249,6 +249,7 @@ void ImageRenderer::DoRender( BufferIndex bufferIndex, Program& program, const M
   DALI_ASSERT_DEBUG( mVertexBuffer );
 
   mTextureCache->BindTexture( mTexture, mTextureId,  GL_TEXTURE_2D, GL_TEXTURE0 );
+  mTexture->ApplySampler( mSamplerBitfield );
 
   // make sure the vertex is bound, this has to be done before
   // we call VertexAttribPointer otherwise you get weird output on the display
index 4959f50..f97a847 100644 (file)
@@ -247,7 +247,7 @@ void MeshRenderer::DoRender( BufferIndex bufferIndex, Program& program, const Ma
 
   if( material.HasTexture() )
   {
-    material.BindTextures( program );
+    material.BindTextures( program, mSamplerBitfield );
   }
   // Always use UV's - may be being used for another purpose by a custom shader!
   texCoordLoc = program.GetAttribLocation(Program::ATTRIB_TEXCOORD);
index 25186fd..55fdbdd 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali/internal/render/shaders/program.h>
 #include <dali/internal/render/renderers/render-data-provider.h>
 #include <dali/public-api/actors/blending.h>
+#include <dali/internal/common/image-sampler.h>
 
 namespace Dali
 {
@@ -139,6 +140,11 @@ void Renderer::SetCullFace( CullFaceMode mode )
   mCullFaceMode = mode;
 }
 
+void Renderer::SetSampler( unsigned int samplerBitfield )
+{
+  mSamplerBitfield = samplerBitfield;
+}
+
 void Renderer::Render( BufferIndex bufferIndex,
                        const Matrix& modelViewMatrix,
                        const Matrix& viewMatrix,
@@ -236,6 +242,7 @@ Renderer::Renderer( RenderDataProvider& dataprovider )
   mContext( NULL ),
   mTextureCache( NULL ),
   mShader( NULL ),
+  mSamplerBitfield( ImageSampler::DefaultOptions() ),
   mUseBlend( false ),
   mCullFaceMode( CullNone )
 {
index 16da342..dfb26bb 100644 (file)
@@ -98,6 +98,12 @@ public:
   void SetCullFace( CullFaceMode mode );
 
   /**
+   * Set the sampler used to render the set texture.
+   * @param[in] samplerBitfield The packed sampler options used to render.
+   */
+  void SetSampler( unsigned int samplerBitfield );
+
+  /**
    * Query whether the derived type of Renderer requires depth testing.
    * @return True if the renderer requires depth testing.
    */
@@ -173,6 +179,7 @@ protected:
   Context* mContext;
   TextureCache* mTextureCache;
   Shader* mShader;
+  unsigned int mSamplerBitfield;          ///< Sampler options used for texture filtering
 
 private:
 
index fecaa0d..81d7c0f 100644 (file)
@@ -475,6 +475,7 @@ void TextRenderer::DoRender( BufferIndex bufferIndex, Program& program, const Ma
   const GLint texCoordLoc = program.GetAttribLocation(Program::ATTRIB_TEXCOORD);
 
   mTexture->Bind(GL_TEXTURE_2D, GL_TEXTURE0);
+  mTexture->ApplySampler( mSamplerBitfield );
 
   mContext->EnableVertexAttributeArray( positionLoc );
   mContext->EnableVertexAttributeArray( texCoordLoc );
index 6b9d3cd..299cc2e 100644 (file)
@@ -32,6 +32,7 @@
 #include <dali/internal/render/gl-resources/texture-cache.h>
 #include <dali/internal/render/shaders/program.h>
 #include <dali/internal/render/shaders/uniform-meta.h>
+#include <dali/internal/common/image-sampler.h>
 
 // See render-debug.h
 #ifdef DALI_PRINT_RENDER_INFO
@@ -317,6 +318,9 @@ void Shader::SetUniforms( Context& context,
   {
     // got effect texture, bind it to texture unit 1
     mTexture->Bind( GL_TEXTURE_2D, GL_TEXTURE1 );
+    // Just apply the default sampling options for now
+    mTexture->ApplySampler( ImageSampler::DefaultOptions() );
+
     // get effect sampler uniform
     const GLint loc = program.GetUniformLocation( Program::UNIFORM_EFFECT_SAMPLER );
     if( Program::UNIFORM_UNKNOWN != loc )
index 01cce90..03159e0 100644 (file)
@@ -28,6 +28,7 @@
 #include <dali/internal/render/queue/render-queue.h>
 #include <dali/internal/render/renderers/scene-graph-renderer.h>
 #include <dali/internal/render/shaders/shader.h>
+#include <dali/internal/common/image-sampler.h>
 
 using namespace std;
 
@@ -178,6 +179,19 @@ void RenderableAttachment::SetCullFace( BufferIndex updateBufferIndex, CullFaceM
   new (slot) DerivedType( &GetRenderer(), &Renderer::SetCullFace, mode );
 }
 
+void RenderableAttachment::SetSampler( BufferIndex updateBufferIndex, unsigned int samplerBitfield )
+{
+  DALI_ASSERT_DEBUG(mSceneController);
+
+  typedef MessageValue1< Renderer, unsigned int > DerivedType;
+
+  // Reserve some memory inside the render queue
+  unsigned int* slot = mSceneController->GetRenderQueue().ReserveMessageSlot( updateBufferIndex, sizeof( DerivedType ) );
+
+  // Construct message in the render queue memory; note that delete should not be called on the return value
+  new (slot) DerivedType( &GetRenderer(), &Renderer::SetSampler, samplerBitfield );
+}
+
 void RenderableAttachment::SetRecalculateScaleForSize()
 {
   mScaleForSizeDirty = true;
index ca393f8..87477a5 100644 (file)
@@ -106,6 +106,13 @@ public: // API
   void SetCullFace( BufferIndex updateBufferIndex, CullFaceMode mode );
 
   /**
+   * Set the sampler used to render the texture for this renderable.
+   * @param[in] updateBufferIndex The current update buffer index.
+   * @param[in] samplerBitfield The image sampler packed options to set.
+   */
+  void SetSampler( BufferIndex updateBufferIndex, unsigned int samplerBitfield );
+
+  /**
    * Flag to check if any geometry scaling is needed, inlined as called from update algorithm often
    * @return true if the derived renderable uses geometry scaling
    */
@@ -392,6 +399,17 @@ inline void SetBlendColorMessage( EventToUpdate& eventToUpdate, const Renderable
   new (slot) LocalType( &attachment, &RenderableAttachment::SetBlendColor, color );
 }
 
+inline void SetSamplerMessage( EventToUpdate& eventToUpdate, const RenderableAttachment& attachment, unsigned int samplerBitfield )
+{
+  typedef MessageDoubleBuffered1< RenderableAttachment, unsigned int > LocalType;
+
+  // Reserve some memory inside the message queue
+  unsigned int* slot = eventToUpdate.ReserveMessageSlot( sizeof( LocalType ) );
+
+  // Construct message in the message queue memory; note that delete should not be called on the return value
+  new (slot) LocalType( &attachment, &RenderableAttachment::SetSampler, samplerBitfield );
+}
+
 } // namespace SceneGraph
 
 } // namespace Internal
index 11ad014..df4dcd6 100644 (file)
@@ -111,6 +111,16 @@ const Vector4& RenderableActor::GetBlendColor() const
   return GetImplementation(*this).GetBlendColor();
 }
 
+void RenderableActor::SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter )
+{
+  GetImplementation(*this).SetFilterMode( minFilter, magFilter );
+}
+
+void RenderableActor::GetFilterMode( FilterMode::Type& minFilter, FilterMode::Type& magFilter ) const
+{
+  GetImplementation(*this).GetFilterMode( minFilter, magFilter );
+}
+
 RenderableActor::RenderableActor(Internal::RenderableActor* internal)
 : Actor(internal)
 {
index 5a25a16..85d0baa 100644 (file)
@@ -22,6 +22,7 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/actors/actor.h>
 #include <dali/public-api/actors/blending.h>
+#include <dali/public-api/actors/sampling.h>
 
 namespace Dali DALI_IMPORT_API
 {
@@ -223,6 +224,29 @@ public:
    */
   const Vector4& GetBlendColor() const;
 
+  /**
+   * @brief Sets the filtering mode.
+   *
+   * Possible values are: FilterMode::NEAREST and FilterMode::LINEAR. Default is FilterMode::LINEAR.
+   *
+   * <ul>
+   *   <li> \e NEAREST Use nearest filtering
+   *   <li> \e LINEAR Use linear filtering
+   * </ul>
+   *
+   * @param[in] minFilter The minification filtering mode.
+   * @param[in] magFilter The magnification filtering mode.
+   */
+  void SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter );
+
+  /**
+   * @brief Retrieves the filtering mode.
+   *
+   * @param[out] minFilter The return minification value
+   * @param[out] magFilter The return magnification value
+   */
+  void GetFilterMode( FilterMode::Type& minFilter, FilterMode::Type& magFilter) const;
+
 public: // Not intended for application developers
 
   /**
diff --git a/dali/public-api/actors/sampling.h b/dali/public-api/actors/sampling.h
new file mode 100644 (file)
index 0000000..f30846c
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef __DALI_SAMPLING_H__
+#define __DALI_SAMPLING_H__
+
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+
+namespace Dali DALI_IMPORT_API
+{
+
+namespace FilterMode
+{
+/**
+ * @brief Texture filtering mode.
+ * @see Dali::RenderableActor::SetFilterMode() and Dali::RenderableActor::GetFilterMode()
+ */
+enum Type
+{
+  DEFAULT,
+  NEAREST,    ///< Filter nearest
+  LINEAR      ///< Filter linear
+};
+
+} //namespace FilterMode
+
+} // namespace Dali
+
+#endif // __DALI_SAMPLING_H__
index 54aa47a..b4e8d52 100644 (file)
@@ -32,6 +32,7 @@
 #include <dali/public-api/actors/model-actor-factory.h>
 #include <dali/public-api/actors/renderable-actor.h>
 #include <dali/public-api/actors/text-actor.h>
+#include <dali/public-api/actors/sampling.h>
 
 #include <dali/public-api/animation/active-constraint-declarations.h>
 #include <dali/public-api/animation/active-constraint.h>
index 3eaa0aa..cdf1c32 100644 (file)
@@ -136,7 +136,8 @@ public_api_core_actors_header_files =  \
   $(public_api_src_dir)/actors/mesh-actor.h \
   $(public_api_src_dir)/actors/model-actor-factory.h \
   $(public_api_src_dir)/actors/text-actor.h \
-  $(public_api_src_dir)/actors/renderable-actor.h
+  $(public_api_src_dir)/actors/renderable-actor.h \
+  $(public_api_src_dir)/actors/sampling.h
 
 public_api_core_animation_header_files = \
   $(public_api_src_dir)/animation/active-constraint.h \