]> git.cworth.org Git - apitrace/commitdiff
Add depth info to the surfaces.
authorZack Rusin <zack@kde.org>
Thu, 17 Nov 2011 03:43:34 +0000 (22:43 -0500)
committerZack Rusin <zack@kde.org>
Thu, 17 Nov 2011 03:43:34 +0000 (22:43 -0500)
gui/apisurface.cpp
gui/apisurface.h
gui/apitracecall.cpp

index 050c081756bf4ef7e1f9079802c0790b7589fe35..b8e820bc82f16f333aed5639fa0e59e93207f0f8 100644 (file)
@@ -44,6 +44,17 @@ QImage ApiSurface::thumb() const
     return m_thumb;
 }
 
+
+int ApiSurface::depth() const
+{
+    return m_depth;
+}
+
+void ApiSurface::setDepth(int depth)
+{
+    m_depth = depth;
+}
+
 ApiTexture::ApiTexture()
     : ApiSurface()
 {
@@ -73,3 +84,4 @@ void ApiFramebuffer::setType(const QString &str)
 {
     m_type = str;
 }
+
index bdf21a38a040d2255f0dc3282a99aa0ebfddd12a..9c7115ec2b4696844157be6ec757585758d82013 100644 (file)
@@ -16,6 +16,9 @@ public:
     int numChannels() const;
     void setNumChannels(int numChannels);
 
+    int depth() const;
+    void setDepth(int depth);
+
     void contentsFromBase64(const QByteArray &base64);
 
     QImage image() const;
@@ -26,6 +29,7 @@ private:
     int m_numChannels;
     QImage m_image;
     QImage m_thumb;
+    int m_depth;
 };
 
 
index 5f2d9765df1cc44d045703b955c852d6a9ded406..26f20bacc1dcad9b46b09f67c28c122807642bc7 100644 (file)
@@ -458,6 +458,8 @@ ApiTraceState::ApiTraceState(const QVariantMap &parsedJson)
             image[QLatin1String("__normalized__")].toBool();
         int numChannels =
             image[QLatin1String("__channels__")].toInt();
+        int depth =
+            image[QLatin1String("__depth__")].toInt();
 
         Q_ASSERT(type == QLatin1String("uint8"));
         Q_ASSERT(normalized == true);
@@ -468,6 +470,7 @@ ApiTraceState::ApiTraceState(const QVariantMap &parsedJson)
 
         ApiTexture tex;
         tex.setSize(size);
+        tex.setDepth(depth);
         tex.setNumChannels(numChannels);
         tex.setLabel(itr.key());
         tex.contentsFromBase64(dataArray);
@@ -485,6 +488,7 @@ ApiTraceState::ApiTraceState(const QVariantMap &parsedJson)
         QString type = buffer[QLatin1String("__type__")].toString();
         bool normalized = buffer[QLatin1String("__normalized__")].toBool();
         int numChannels = buffer[QLatin1String("__channels__")].toInt();
+        int depth = buffer[QLatin1String("__depth__")].toInt();
 
         Q_ASSERT(type == QLatin1String("uint8"));
         Q_ASSERT(normalized == true);
@@ -495,6 +499,7 @@ ApiTraceState::ApiTraceState(const QVariantMap &parsedJson)
 
         ApiFramebuffer fbo;
         fbo.setSize(size);
+        fbo.setDepth(depth);
         fbo.setNumChannels(numChannels);
         fbo.setType(itr.key());
         fbo.contentsFromBase64(dataArray);