Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: core/fxge/android/fpf_skiafontmgr.cpp

Issue 2430743003: in the attempt to fix 627393, changed IFX_FileRead's readBlock to return the length it reads
Patch Set: remove .tmp files Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fxcrt/include/fx_system.h" 7 #include "core/fxcrt/include/fx_system.h"
8 8
9 #if _FX_OS_ == _FX_ANDROID_ 9 #if _FX_OS_ == _FX_ANDROID_
10 10
(...skipping 12 matching lines...) Expand all
23 #endif 23 #endif
24 static unsigned long FPF_SkiaStream_Read(FXFT_Stream stream, 24 static unsigned long FPF_SkiaStream_Read(FXFT_Stream stream,
25 unsigned long offset, 25 unsigned long offset,
26 unsigned char* buffer, 26 unsigned char* buffer,
27 unsigned long count) { 27 unsigned long count) {
28 IFX_FileRead* pFileRead = (IFX_FileRead*)stream->descriptor.pointer; 28 IFX_FileRead* pFileRead = (IFX_FileRead*)stream->descriptor.pointer;
29 if (!pFileRead) { 29 if (!pFileRead) {
30 return 0; 30 return 0;
31 } 31 }
32 if (count > 0) { 32 if (count > 0) {
33 if (!pFileRead->ReadBlock(buffer, (FX_FILESIZE)offset, (size_t)count)) { 33 if (pFileRead->ReadBlock(buffer, (FX_FILESIZE)offset, (size_t)count) !=
34 static_cast<size_t>(count) &&
35 !pFileRead->IsEOF()) {
34 return 0; 36 return 0;
35 } 37 }
36 } 38 }
37 return count; 39 return count;
38 } 40 }
39 static void FPF_SkiaStream_Close(FXFT_Stream stream) {} 41 static void FPF_SkiaStream_Close(FXFT_Stream stream) {}
40 #ifdef __cplusplus 42 #ifdef __cplusplus
41 }; 43 };
42 #endif 44 #endif
43 struct FPF_SKIAFONTMAP { 45 struct FPF_SKIAFONTMAP {
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 } 516 }
515 if (pOS2 && (pOS2->ulCodePageRange1 & (1 << 31))) { 517 if (pOS2 && (pOS2->ulCodePageRange1 & (1 << 31))) {
516 pFontDesc->m_dwStyle |= FXFONT_SYMBOLIC; 518 pFontDesc->m_dwStyle |= FXFONT_SYMBOLIC;
517 } 519 }
518 pFontDesc->m_dwCharsets = FPF_SkiaGetFaceCharset(pOS2); 520 pFontDesc->m_dwCharsets = FPF_SkiaGetFaceCharset(pOS2);
519 pFontDesc->m_iFaceIndex = face->face_index; 521 pFontDesc->m_iFaceIndex = face->face_index;
520 pFontDesc->m_iGlyphNum = face->num_glyphs; 522 pFontDesc->m_iGlyphNum = face->num_glyphs;
521 } 523 }
522 void CFPF_SkiaFontMgr::OutputSystemFonts() {} 524 void CFPF_SkiaFontMgr::OutputSystemFonts() {}
523 #endif 525 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698