bungeman@google.com | 72cf4fc | 2014-03-21 22:48:32 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
mtklein | ffa4a92 | 2016-05-05 16:05:56 -0700 | [diff] [blame] | 8 | #include "SkOnce.h" |
bungeman@google.com | 72cf4fc | 2014-03-21 22:48:32 +0000 | [diff] [blame] | 9 | #include "SkRemotableFontMgr.h" |
| 10 | |
bungeman@google.com | 72cf4fc | 2014-03-21 22:48:32 +0000 | [diff] [blame] | 11 | SkRemotableFontIdentitySet::SkRemotableFontIdentitySet(int count, SkFontIdentity** data) |
| 12 | : fCount(count), fData(count) |
| 13 | { |
| 14 | SkASSERT(data); |
| 15 | *data = fData; |
| 16 | } |
| 17 | |
bungeman@google.com | 72cf4fc | 2014-03-21 22:48:32 +0000 | [diff] [blame] | 18 | SkRemotableFontIdentitySet* SkRemotableFontIdentitySet::NewEmpty() { |
mtklein | ffa4a92 | 2016-05-05 16:05:56 -0700 | [diff] [blame] | 19 | static SkOnce once; |
| 20 | static SkRemotableFontIdentitySet* empty; |
| 21 | once([]{ empty = new SkRemotableFontIdentitySet; }); |
| 22 | return SkRef(empty); |
bungeman@google.com | 72cf4fc | 2014-03-21 22:48:32 +0000 | [diff] [blame] | 23 | } |