Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / include / core / SkMatrix.h
index a65cd19..71d9525 100644 (file)
@@ -543,8 +543,8 @@ public:
         return 0 == memcmp(fMat, m.fMat, sizeof(fMat));
     }
 
-    friend bool operator==(const SkMatrix& a, const SkMatrix& b);
-    friend bool operator!=(const SkMatrix& a, const SkMatrix& b) {
+    friend SK_API bool operator==(const SkMatrix& a, const SkMatrix& b);
+    friend SK_API bool operator!=(const SkMatrix& a, const SkMatrix& b) {
         return !(a == b);
     }
 
@@ -564,8 +564,8 @@ public:
      */
     size_t readFromMemory(const void* buffer, size_t length);
 
-    SkDEVCODE(void dump() const;)
-    SK_TO_STRING_NONVIRT()
+    void dump() const;
+    void toString(SkString*) const;
 
     /**
      * Calculates the minimum scaling factor of the matrix as computed from the SVD of the upper
@@ -650,6 +650,29 @@ private:
     SkScalar         fMat[9];
     mutable SkTRacy<uint32_t> fTypeMask;
 
+    void setScaleTranslate(SkScalar sx, SkScalar sy, SkScalar tx, SkScalar ty) {
+        fMat[kMScaleX] = sx;
+        fMat[kMSkewX]  = 0;
+        fMat[kMTransX] = tx;
+        
+        fMat[kMSkewY]  = 0;
+        fMat[kMScaleY] = sy;
+        fMat[kMTransY] = ty;
+        
+        fMat[kMPersp0] = 0;
+        fMat[kMPersp1] = 0;
+        fMat[kMPersp2] = 1;
+        
+        unsigned mask = 0;
+        if (sx != 1 || sy != 1) {
+            mask |= kScale_Mask;
+        }
+        if (tx || ty) {
+            mask |= kTranslate_Mask;
+        }
+        this->setTypeMask(mask | kRectStaysRect_Mask);
+    }
+
     uint8_t computeTypeMask() const;
     uint8_t computePerspectiveTypeMask() const;