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

Unified Diff: source/test/letest/FontTableCache.cpp

Issue 2435373002: Delete source/test (Closed)
Patch Set: 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 | « source/test/letest/FontTableCache.h ('k') | source/test/letest/Makefile.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/test/letest/FontTableCache.cpp
diff --git a/source/test/letest/FontTableCache.cpp b/source/test/letest/FontTableCache.cpp
deleted file mode 100644
index a2c0727a2123b1e38a25e2a2fee1e075cd815f66..0000000000000000000000000000000000000000
--- a/source/test/letest/FontTableCache.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- **********************************************************************
- * Copyright (C) 2003-2013, International Business Machines
- * Corporation and others. All Rights Reserved.
- **********************************************************************
- */
-
-#include "layout/LETypes.h"
-
-//#include "letest.h"
-#include "FontTableCache.h"
-
-#define TABLE_CACHE_INIT 5
-#define TABLE_CACHE_GROW 5
-
-struct FontTableCacheEntry
-{
- LETag tag;
- const void *table;
- size_t length;
-};
-
-FontTableCache::FontTableCache()
- : fTableCacheCurr(0), fTableCacheSize(TABLE_CACHE_INIT)
-{
- fTableCache = LE_NEW_ARRAY(FontTableCacheEntry, fTableCacheSize);
-
- if (fTableCache == NULL) {
- fTableCacheSize = 0;
- return;
- }
-
- for (int i = 0; i < fTableCacheSize; i += 1) {
- fTableCache[i].tag = 0;
- fTableCache[i].table = NULL;
- fTableCache[i].length = 0;
- }
-}
-
-FontTableCache::~FontTableCache()
-{
- for (int i = fTableCacheCurr - 1; i >= 0; i -= 1) {
- LE_DELETE_ARRAY(fTableCache[i].table);
-
- fTableCache[i].tag = 0;
- fTableCache[i].table = NULL;
- fTableCache[i].length = 0;
- }
-
- fTableCacheCurr = 0;
-
- LE_DELETE_ARRAY(fTableCache);
-}
-
-void FontTableCache::freeFontTable(const void *table) const
-{
- LE_DELETE_ARRAY(table);
-}
-
-const void *FontTableCache::find(LETag tableTag, size_t &length) const
-{
- for (int i = 0; i < fTableCacheCurr; i += 1) {
- if (fTableCache[i].tag == tableTag) {
- length = fTableCache[i].length;
- return fTableCache[i].table;
- }
- }
-
- const void *table = readFontTable(tableTag, length);
-
- ((FontTableCache *) this)->add(tableTag, table, length);
-
- return table;
-}
-
-void FontTableCache::add(LETag tableTag, const void *table, size_t length)
-{
- if (fTableCacheCurr >= fTableCacheSize) {
- le_int32 newSize = fTableCacheSize + TABLE_CACHE_GROW;
-
- fTableCache = (FontTableCacheEntry *) LE_GROW_ARRAY(fTableCache, newSize);
-
- for (le_int32 i = fTableCacheSize; i < newSize; i += 1) {
- fTableCache[i].tag = 0;
- fTableCache[i].table = NULL;
- fTableCache[i].length = 0;
- }
-
- fTableCacheSize = newSize;
- }
-
- fTableCache[fTableCacheCurr].tag = tableTag;
- fTableCache[fTableCacheCurr].table = table;
- fTableCache[fTableCacheCurr].length = length;
-
- fTableCacheCurr += 1;
-}
« no previous file with comments | « source/test/letest/FontTableCache.h ('k') | source/test/letest/Makefile.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698