[clutter/android-enter-leave: 12/29] stage: add samples-per-pixel property for anti-aliasing setup



commit d5514d6a9c368608f3714015bd1f946d56112bd5
Author: Lionel Landwerlin <llandwerlin gmail com>
Date:   Tue Jun 12 14:25:48 2012 +0100

    stage: add samples-per-pixel property for anti-aliasing setup

 clutter/clutter-stage.c |   30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c
index df835ac..8ce3c35 100644
--- a/clutter/clutter-stage.c
+++ b/clutter/clutter-stage.c
@@ -194,7 +194,8 @@ enum
   PROP_USE_ALPHA,
   PROP_KEY_FOCUS,
   PROP_NO_CLEAR_HINT,
-  PROP_ACCEPT_FOCUS
+  PROP_ACCEPT_FOCUS,
+  PROP_SAMPLES_PER_PIXEL
 };
 
 enum
@@ -1709,6 +1710,12 @@ clutter_stage_set_property (GObject      *object,
       clutter_stage_set_accept_focus (stage, g_value_get_boolean (value));
       break;
 
+    case PROP_SAMPLES_PER_PIXEL:
+      cogl_framebuffer_set_samples_per_pixel (
+        _clutter_stage_window_get_active_framebuffer (CLUTTER_STAGE_WINDOW (stage->priv->impl)),
+        g_value_get_uint (value));
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -1788,6 +1795,13 @@ clutter_stage_get_property (GObject    *gobject,
       g_value_set_boolean (value, priv->accept_focus);
       break;
 
+    case PROP_SAMPLES_PER_PIXEL:
+      g_value_set_uint (value,
+        cogl_framebuffer_get_samples_per_pixel (
+        _clutter_stage_window_get_active_framebuffer (CLUTTER_STAGE_WINDOW (priv->impl))));
+      break;
+
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
       break;
@@ -2078,6 +2092,20 @@ clutter_stage_class_init (ClutterStageClass *klass)
   g_object_class_install_property (gobject_class, PROP_NO_CLEAR_HINT, pspec);
 
   /**
+   * ClutterStage:samples-per-pixel:
+   *
+   * Set the number of samples per pixel on #ClutterStage.
+   *
+   * Since: 1.12
+   */
+  pspec = g_param_spec_uint ("samples-per-pixel",
+                             P_("Samples per pixel"),
+                             P_("Number of samples per pixel"),
+                             0, G_MAXUINT, 0,
+                             CLUTTER_PARAM_READWRITE);
+  g_object_class_install_property (gobject_class, PROP_SAMPLES_PER_PIXEL, pspec);
+
+  /**
    * ClutterStage:accept-focus:
    *
    * Whether the #ClutterStage should accept key focus when shown.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]