~ubuntu-branches/ubuntu/karmic/gears/karmic

« back to all changes in this revision

Viewing changes to third_party/skia/include/core/SkGraphics.h

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Lesicnik
  • Date: 2009-04-30 19:15:25 UTC
  • Revision ID: james.westby@ubuntu.com-20090430191525-0790sb5wzg8ou0xb
Tags: upstream-0.5.21.0~svn3334+dfsg
ImportĀ upstreamĀ versionĀ 0.5.21.0~svn3334+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2006 The Android Open Source Project
 
3
 *
 
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
 
7
 *
 
8
 *      http://www.apache.org/licenses/LICENSE-2.0
 
9
 *
 
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.
 
15
 */
 
16
 
 
17
#ifndef SkGraphics_DEFINED
 
18
#define SkGraphics_DEFINED
 
19
 
 
20
#include "SkTypes.h"
 
21
 
 
22
class SkGraphics {
 
23
public:
 
24
    static void Init(bool runUnitTests);
 
25
    static void Term();
 
26
 
 
27
    /** Return the (approximate) number of bytes used by the font cache.
 
28
    */
 
29
    static size_t GetFontCacheUsed();
 
30
    
 
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.
 
34
    */
 
35
    static bool SetFontCacheUsed(size_t usageInBytes);
 
36
    
 
37
private:
 
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()
 
41
    */
 
42
    static void InstallNewHandler();
 
43
};
 
44
 
 
45
#endif
 
46