Home | History | Annotate | Download | only in fxge
      1 // Copyright 2016 PDFium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
      6 
      7 #ifndef CORE_FXGE_CFX_DEFAULTRENDERDEVICE_H_
      8 #define CORE_FXGE_CFX_DEFAULTRENDERDEVICE_H_
      9 
     10 #include "core/fxge/cfx_renderdevice.h"
     11 #include "core/fxge/fx_dib.h"
     12 
     13 class SkPictureRecorder;
     14 
     15 class CFX_DefaultRenderDevice : public CFX_RenderDevice {
     16  public:
     17   CFX_DefaultRenderDevice();
     18   ~CFX_DefaultRenderDevice() override;
     19 
     20   bool Attach(const RetainPtr<CFX_DIBitmap>& pBitmap,
     21               bool bRgbByteOrder,
     22               const RetainPtr<CFX_DIBitmap>& pOriDevice,
     23               bool bGroupKnockout);
     24   bool Create(int width,
     25               int height,
     26               FXDIB_Format format,
     27               const RetainPtr<CFX_DIBitmap>& pOriDevice);
     28 
     29 #ifdef _SKIA_SUPPORT_
     30   bool AttachRecorder(SkPictureRecorder* recorder);
     31   void Clear(uint32_t color);
     32   SkPictureRecorder* CreateRecorder(int size_x, int size_y);
     33   void DebugVerifyBitmapIsPreMultiplied() const override;
     34   bool SetBitsWithMask(const RetainPtr<CFX_DIBSource>& pBitmap,
     35                        const RetainPtr<CFX_DIBSource>& pMask,
     36                        int left,
     37                        int top,
     38                        int bitmap_alpha,
     39                        int blend_type) override;
     40 #endif
     41 };
     42 
     43 #endif  // CORE_FXGE_CFX_DEFAULTRENDERDEVICE_H_
     44