| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef GrContext_DEFINED | 8 #ifndef GrContext_DEFINED |
| 9 #define GrContext_DEFINED | 9 #define GrContext_DEFINED |
| 10 | 10 |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 static void TextBlobCacheOverBudgetCB(void* data); | 479 static void TextBlobCacheOverBudgetCB(void* data); |
| 480 | 480 |
| 481 typedef SkRefCnt INHERITED; | 481 typedef SkRefCnt INHERITED; |
| 482 }; | 482 }; |
| 483 | 483 |
| 484 /** | 484 /** |
| 485 * Can be used to perform actions related to the generating GrContext in a threa
d safe manner. The | 485 * Can be used to perform actions related to the generating GrContext in a threa
d safe manner. The |
| 486 * proxy does not access the 3D API (e.g. OpenGL) that backs the generating GrCo
ntext. | 486 * proxy does not access the 3D API (e.g. OpenGL) that backs the generating GrCo
ntext. |
| 487 */ | 487 */ |
| 488 class GrContextThreadSafeProxy : public SkRefCnt { | 488 class GrContextThreadSafeProxy : public SkRefCnt { |
| 489 public: |
| 490 uint32_t uniqueID() const { return fContextUniqueID; } |
| 491 |
| 489 private: | 492 private: |
| 490 GrContextThreadSafeProxy(sk_sp<const GrCaps> caps, uint32_t uniqueID) | 493 GrContextThreadSafeProxy(sk_sp<const GrCaps> caps, uint32_t uniqueID) |
| 491 : fCaps(std::move(caps)) | 494 : fCaps(std::move(caps)) |
| 492 , fContextUniqueID(uniqueID) {} | 495 , fContextUniqueID(uniqueID) {} |
| 493 | 496 |
| 494 sk_sp<const GrCaps> fCaps; | 497 sk_sp<const GrCaps> fCaps; |
| 495 uint32_t fContextUniqueID; | 498 uint32_t fContextUniqueID; |
| 496 | 499 |
| 497 friend class GrContext; | 500 friend class GrContext; |
| 498 friend class SkImage; | 501 friend class SkImage; |
| 499 | 502 |
| 500 typedef SkRefCnt INHERITED; | 503 typedef SkRefCnt INHERITED; |
| 501 }; | 504 }; |
| 502 | 505 |
| 503 #endif | 506 #endif |
| OLD | NEW |