2
* Copyright (C) 2006 The Android Open Source Project
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
17
#ifndef SkGraphics_DEFINED
18
#define SkGraphics_DEFINED
24
static void Init(bool runUnitTests);
27
/** Return the (approximate) number of bytes used by the font cache.
29
static size_t GetFontCacheUsed();
31
/** Attempt to purge the font cache until <= the specified amount remains
32
in the cache. Specifying 0 will attempt to purge the entire cache.
33
Returns true if some amount was purged from the font cache.
35
static bool SetFontCacheUsed(size_t usageInBytes);
38
/** This is automatically called by SkGraphics::Init(), and must be
39
implemented by the host OS. This allows the host OS to register a callback
40
with the C++ runtime to call SkGraphics::FreeCaches()
42
static void InstallNewHandler();