Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / include / core / SkDevice.h
index de2f8dd..08320bf 100644 (file)
@@ -12,7 +12,6 @@
 #include "SkBitmap.h"
 #include "SkCanvas.h"
 #include "SkColor.h"
-#include "SkDeviceProperties.h"
 #include "SkImageFilter.h"
 
 class SkClipStack;
@@ -21,7 +20,7 @@ struct SkIRect;
 class SkMatrix;
 class SkMetaData;
 class SkRegion;
-
+struct SkDeviceProperties;
 class GrRenderTarget;
 
 class SK_API SkBaseDevice : public SkRefCnt {
@@ -32,24 +31,12 @@ public:
      *  Construct a new device.
     */
     SkBaseDevice();
-
-    /**
-     *  Construct a new device.
-    */
-    SkBaseDevice(const SkDeviceProperties& deviceProperties);
-
     virtual ~SkBaseDevice();
 
     SkBaseDevice* createCompatibleDevice(const SkImageInfo&);
 
     SkMetaData& getMetaData();
 
-    /** Return the image properties of the device. */
-    virtual const SkDeviceProperties& getDeviceProperties() const {
-        //Currently, all the properties are leaky.
-        return fLeakyProperties;
-    }
-
     /**
      *  Return ImageInfo for this device. If the canvas is not backed by pixels
      *  (cpu or gpu), then the info's ColorType will be kUnknown_SkColorType.
@@ -138,8 +125,7 @@ protected:
     };
 
     struct TextFlags {
-        uint32_t            fFlags;     // SkPaint::getFlags()
-        SkPaint::Hinting    fHinting;
+        uint32_t    fFlags;     // SkPaint::getFlags()
     };
 
     /**
@@ -242,6 +228,9 @@ protected:
                               const SkColor colors[], SkXfermode* xmode,
                               const uint16_t indices[], int indexCount,
                               const SkPaint& paint) = 0;
+    // default implementation unrolls the blob runs.
+    virtual void drawTextBlob(const SkDraw&, const SkTextBlob*, SkScalar x, SkScalar y,
+                              const SkPaint& paint);
     // default implementation calls drawVertices
     virtual void drawPatch(const SkDraw&, const SkPoint cubics[12], const SkColor colors[4],
                            const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint);
@@ -299,7 +288,7 @@ protected:
 
 protected:
     // default impl returns NULL
-    virtual SkSurface* newSurface(const SkImageInfo&);
+    virtual SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&);
 
     // default impl returns NULL
     virtual const void* peekPixels(SkImageInfo*, size_t* rowBytes);
@@ -331,7 +320,9 @@ protected:
      *  If the device does handle a property, that property should be set to the identity value
      *  for that property, effectively making it non-leaky.
      */
-    SkDeviceProperties fLeakyProperties;
+    const SkDeviceProperties& getLeakyProperties() const {
+        return *fLeakyProperties;
+    }
 
     /**
      *  PRIVATE / EXPERIMENTAL -- do not call
@@ -352,6 +343,8 @@ protected:
     virtual bool EXPERIMENTAL_drawPicture(SkCanvas*, const SkPicture*, const SkMatrix*,
                                           const SkPaint*);
 
+    void setPixelGeometry(SkPixelGeometry geo);
+
 private:
     friend class SkCanvas;
     friend struct DeviceCM; //for setMatrixClip
@@ -369,6 +362,8 @@ private:
     // TODO: move to SkBitmapDevice
     virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) {}
 
+    virtual bool forceConservativeRasterClip() const { return false; }
+
     // just called by SkCanvas when built as a layer
     void setOrigin(int x, int y) { fOrigin.set(x, y); }
     // just called by SkCanvas for saveLayer
@@ -386,6 +381,7 @@ private:
 
     SkIPoint    fOrigin;
     SkMetaData* fMetaData;
+    SkDeviceProperties* fLeakyProperties;   // will always exist.
 
 #ifdef SK_DEBUG
     bool        fAttachedToCanvas;