Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / printing / pdf_metafile_skia.h
index f46fd3c..bc75abd 100644 (file)
@@ -15,6 +15,8 @@
 #include <windows.h>
 #endif
 
+class SkBaseDevice;
+
 #if defined(OS_CHROMEOS) || defined(OS_ANDROID)
 namespace base {
 struct FileDescriptor;
@@ -29,41 +31,35 @@ struct PdfMetafileSkiaData;
 class PRINTING_EXPORT PdfMetafileSkia : public Metafile {
  public:
   PdfMetafileSkia();
-  virtual ~PdfMetafileSkia();
+  ~PdfMetafileSkia() override;
 
   // Metafile methods.
-  virtual bool Init() OVERRIDE;
-  virtual bool InitFromData(const void* src_buffer,
-                            uint32 src_buffer_size) OVERRIDE;
-
-  virtual SkBaseDevice* StartPageForVectorCanvas(
-      const gfx::Size& page_size,
-      const gfx::Rect& content_area,
-      const float& scale_factor) OVERRIDE;
+  bool Init() override;
+  bool InitFromData(const void* src_buffer, uint32 src_buffer_size) override;
 
-  virtual bool StartPage(const gfx::Size& page_size,
-                         const gfx::Rect& content_area,
-                         const float& scale_factor) OVERRIDE;
-  virtual bool FinishPage() OVERRIDE;
-  virtual bool FinishDocument() OVERRIDE;
+  bool StartPage(const gfx::Size& page_size,
+                 const gfx::Rect& content_area,
+                 const float& scale_factor) override;
+  bool FinishPage() override;
+  bool FinishDocument() override;
 
-  virtual uint32 GetDataSize() const OVERRIDE;
-  virtual bool GetData(void* dst_buffer, uint32 dst_buffer_size) const OVERRIDE;
+  uint32 GetDataSize() const override;
+  bool GetData(void* dst_buffer, uint32 dst_buffer_size) const override;
 
-  virtual gfx::Rect GetPageBounds(unsigned int page_number) const OVERRIDE;
-  virtual unsigned int GetPageCount() const OVERRIDE;
+  gfx::Rect GetPageBounds(unsigned int page_number) const override;
+  unsigned int GetPageCount() const override;
 
-  virtual gfx::NativeDrawingContext context() const OVERRIDE;
+  gfx::NativeDrawingContext context() const override;
 
 #if defined(OS_WIN)
   virtual bool Playback(gfx::NativeDrawingContext hdc,
-                        const RECT* rect) const OVERRIDE;
-  virtual bool SafePlayback(gfx::NativeDrawingContext hdc) const OVERRIDE;
+                        const RECT* rect) const override;
+  virtual bool SafePlayback(gfx::NativeDrawingContext hdc) const override;
 #elif defined(OS_MACOSX)
-  virtual bool RenderPage(unsigned int page_number,
-                          gfx::NativeDrawingContext context,
-                          const CGRect rect,
-                          const MacRenderPageParams& params) const OVERRIDE;
+  bool RenderPage(unsigned int page_number,
+                  gfx::NativeDrawingContext context,
+                  const CGRect rect,
+                  const MacRenderPageParams& params) const override;
 #endif
 
 #if defined(OS_CHROMEOS) || defined(OS_ANDROID)
@@ -74,6 +70,12 @@ class PRINTING_EXPORT PdfMetafileSkia : public Metafile {
   // Return a new metafile containing just the current page in draft mode.
   scoped_ptr<PdfMetafileSkia> GetMetafileForCurrentPage();
 
+  // This method calls StartPage and then returns an appropriate
+  // VectorPlatformDevice implementation bound to the context created by
+  // StartPage or NULL on error.
+  SkBaseDevice* StartPageForVectorCanvas(const gfx::Size& page_size,
+                                         const gfx::Rect& content_area,
+                                         const float& scale_factor);
  private:
   scoped_ptr<PdfMetafileSkiaData> data_;