OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #if SK_SUPPORT_GPU | 9 #if SK_SUPPORT_GPU |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 static GrResourceKey ComputeKey(const GrTextureDesc& desc) { | 64 static GrResourceKey ComputeKey(const GrTextureDesc& desc) { |
65 return GrTexture::ComputeScratchKey(desc); | 65 return GrTexture::ComputeScratchKey(desc); |
66 } | 66 } |
67 | 67 |
68 int fID; | 68 int fID; |
69 | 69 |
70 private: | 70 private: |
71 typedef GrResource INHERITED; | 71 typedef GrResource INHERITED; |
72 }; | 72 }; |
73 | 73 |
74 SK_DEFINE_INST_COUNT(StencilResource) | |
75 SK_DEFINE_INST_COUNT(TextureResource) | |
76 | |
77 static void get_stencil(int i, int* w, int* h, int* s) { | 74 static void get_stencil(int i, int* w, int* h, int* s) { |
78 *w = i % 1024; | 75 *w = i % 1024; |
79 *h = i * 2 % 1024; | 76 *h = i * 2 % 1024; |
80 *s = i % 1 == 0 ? 0 : 4; | 77 *s = i % 1 == 0 ? 0 : 4; |
81 } | 78 } |
82 | 79 |
83 static void get_texture_desc(int i, GrTextureDesc* desc) { | 80 static void get_texture_desc(int i, GrTextureDesc* desc) { |
84 desc->fFlags = kRenderTarget_GrTextureFlagBit | | 81 desc->fFlags = kRenderTarget_GrTextureFlagBit | |
85 kNoStencil_GrTextureFlagBit; | 82 kNoStencil_GrTextureFlagBit; |
86 desc->fWidth = i % 1024; | 83 desc->fWidth = i % 1024; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 } | 230 } |
234 | 231 |
235 private: | 232 private: |
236 typedef SkBenchmark INHERITED; | 233 typedef SkBenchmark INHERITED; |
237 }; | 234 }; |
238 | 235 |
239 DEF_BENCH( return new GrResourceCacheBenchAdd(); ) | 236 DEF_BENCH( return new GrResourceCacheBenchAdd(); ) |
240 DEF_BENCH( return new GrResourceCacheBenchFind(); ) | 237 DEF_BENCH( return new GrResourceCacheBenchFind(); ) |
241 | 238 |
242 #endif | 239 #endif |
OLD | NEW |