OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "SkGpuDevice.h" | 8 #include "SkGpuDevice.h" |
9 | 9 |
10 #include "GrBlurUtils.h" | 10 #include "GrBlurUtils.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #include "effects/GrDashingEffect.h" | 46 #include "effects/GrDashingEffect.h" |
47 #include "effects/GrSimpleTextureEffect.h" | 47 #include "effects/GrSimpleTextureEffect.h" |
48 #include "effects/GrTextureDomain.h" | 48 #include "effects/GrTextureDomain.h" |
49 #include "text/GrTextUtils.h" | 49 #include "text/GrTextUtils.h" |
50 | 50 |
51 #if SK_SUPPORT_GPU | 51 #if SK_SUPPORT_GPU |
52 | 52 |
53 #define ASSERT_SINGLE_OWNER \ | 53 #define ASSERT_SINGLE_OWNER \ |
54 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(fContext->debugSing
leOwner());) | 54 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(fContext->debugSing
leOwner());) |
55 | 55 |
56 enum { kDefaultImageFilterCacheSize = 32 * 1024 * 1024 }; | |
57 | |
58 #if 0 | 56 #if 0 |
59 extern bool (*gShouldDrawProc)(); | 57 extern bool (*gShouldDrawProc)(); |
60 #define CHECK_SHOULD_DRAW(draw) \ | 58 #define CHECK_SHOULD_DRAW(draw) \ |
61 do { \ | 59 do { \ |
62 if (gShouldDrawProc && !gShouldDrawProc()) return; \ | 60 if (gShouldDrawProc && !gShouldDrawProc()) return; \ |
63 this->prepareDraw(draw); \ | 61 this->prepareDraw(draw); \ |
64 } while (0) | 62 } while (0) |
65 #else | 63 #else |
66 #define CHECK_SHOULD_DRAW(draw) this->prepareDraw(draw) | 64 #define CHECK_SHOULD_DRAW(draw) this->prepareDraw(draw) |
67 #endif | 65 #endif |
(...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1811 // TODO: Change the signature of newSurface to take a budgeted parameter. | 1809 // TODO: Change the signature of newSurface to take a budgeted parameter. |
1812 static const SkBudgeted kBudgeted = SkBudgeted::kNo; | 1810 static const SkBudgeted kBudgeted = SkBudgeted::kNo; |
1813 return SkSurface::MakeRenderTarget(fContext, kBudgeted, info, fDrawContext->
desc().fSampleCnt, | 1811 return SkSurface::MakeRenderTarget(fContext, kBudgeted, info, fDrawContext->
desc().fSampleCnt, |
1814 fDrawContext->origin(), &props); | 1812 fDrawContext->origin(), &props); |
1815 } | 1813 } |
1816 | 1814 |
1817 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { | 1815 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { |
1818 ASSERT_SINGLE_OWNER | 1816 ASSERT_SINGLE_OWNER |
1819 // We always return a transient cache, so it is freed after each | 1817 // We always return a transient cache, so it is freed after each |
1820 // filter traversal. | 1818 // filter traversal. |
1821 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize); | 1819 return SkImageFilterCache::Create(SkImageFilterCache::kDefaultTransientSize)
; |
1822 } | 1820 } |
1823 | 1821 |
1824 #endif | 1822 #endif |
OLD | NEW |