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

Unified Diff: core/fpdfapi/fpdf_render/cpdf_type3glyphs.cpp

Issue 2393593002: Move core/fpdfapi/fpdf_render to core/fpdfapi/render (Closed)
Patch Set: Rebase to master 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_render/cpdf_type3glyphs.h ('k') | core/fpdfapi/fpdf_render/fpdf_render.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_render/cpdf_type3glyphs.cpp
diff --git a/core/fpdfapi/fpdf_render/cpdf_type3glyphs.cpp b/core/fpdfapi/fpdf_render/cpdf_type3glyphs.cpp
deleted file mode 100644
index e811c2bd8cc7b842201feda6da3c2c4f5671981c..0000000000000000000000000000000000000000
--- a/core/fpdfapi/fpdf_render/cpdf_type3glyphs.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "core/fpdfapi/fpdf_render/cpdf_type3glyphs.h"
-
-#include <map>
-
-#include "core/fxge/fx_font.h"
-
-CPDF_Type3Glyphs::CPDF_Type3Glyphs()
- : m_TopBlueCount(0), m_BottomBlueCount(0) {}
-
-CPDF_Type3Glyphs::~CPDF_Type3Glyphs() {
- for (const auto& pair : m_GlyphMap)
- delete pair.second;
-}
-
-static int _AdjustBlue(FX_FLOAT pos, int& count, int blues[]) {
- FX_FLOAT min_distance = 1000000.0f;
- int closest_pos = -1;
- for (int i = 0; i < count; i++) {
- FX_FLOAT distance = FXSYS_fabs(pos - static_cast<FX_FLOAT>(blues[i]));
- if (distance < 1.0f * 80.0f / 100.0f && distance < min_distance) {
- min_distance = distance;
- closest_pos = i;
- }
- }
- if (closest_pos >= 0)
- return blues[closest_pos];
- int new_pos = FXSYS_round(pos);
- if (count == TYPE3_MAX_BLUES)
- return new_pos;
- blues[count++] = new_pos;
- return new_pos;
-}
-
-void CPDF_Type3Glyphs::AdjustBlue(FX_FLOAT top,
- FX_FLOAT bottom,
- int& top_line,
- int& bottom_line) {
- top_line = _AdjustBlue(top, m_TopBlueCount, m_TopBlue);
- bottom_line = _AdjustBlue(bottom, m_BottomBlueCount, m_BottomBlue);
-}
« no previous file with comments | « core/fpdfapi/fpdf_render/cpdf_type3glyphs.h ('k') | core/fpdfapi/fpdf_render/fpdf_render.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698