Home | History | Annotate | Download | only in android
      1 // Copyright 2017 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 #include "core/fxge/android/cfpf_skiapathfont.h"
      8 
      9 #include "core/fxcrt/fx_memory.h"
     10 
     11 CFPF_SkiaPathFont::CFPF_SkiaPathFont() : m_pPath(nullptr) {}
     12 
     13 CFPF_SkiaPathFont::~CFPF_SkiaPathFont() {
     14   FX_Free(m_pPath);
     15 }
     16 
     17 int32_t CFPF_SkiaPathFont::GetType() const {
     18   return FPF_SKIAFONTTYPE_Path;
     19 }
     20 
     21 void CFPF_SkiaPathFont::SetPath(const char* pPath) {
     22   FX_Free(m_pPath);
     23   int32_t iSize = strlen(pPath);
     24   m_pPath = FX_Alloc(char, iSize + 1);
     25   memcpy(m_pPath, pPath, iSize * sizeof(char));
     26   m_pPath[iSize] = 0;
     27 }
     28