OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 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 #include "GrGpuResourcePriv.h" | 9 #include "GrGpuResourcePriv.h" |
10 #include "GrLayerAtlas.h" | 10 #include "GrLayerAtlas.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 void GrLayerAtlas::createBackingTexture() { | 60 void GrLayerAtlas::createBackingTexture() { |
61 SkASSERT(!fTexture); | 61 SkASSERT(!fTexture); |
62 | 62 |
63 GrSurfaceDesc desc; | 63 GrSurfaceDesc desc; |
64 desc.fFlags = fFlags; | 64 desc.fFlags = fFlags; |
65 desc.fWidth = fBackingTextureSize.width(); | 65 desc.fWidth = fBackingTextureSize.width(); |
66 desc.fHeight = fBackingTextureSize.height(); | 66 desc.fHeight = fBackingTextureSize.height(); |
67 desc.fConfig = fPixelConfig; | 67 desc.fConfig = fPixelConfig; |
68 | 68 |
69 fTexture.reset(fTexProvider->createTexture(desc, true, nullptr, 0)); | 69 fTexture.reset(fTexProvider->createTexture(desc, SkBudgeted::kYes, nullptr,
0)); |
70 | 70 |
71 fTexture->resourcePriv().setUniqueKey(get_layer_atlas_key()); | 71 fTexture->resourcePriv().setUniqueKey(get_layer_atlas_key()); |
72 } | 72 } |
73 | 73 |
74 GrLayerAtlas::GrLayerAtlas(GrTextureProvider* texProvider, GrPixelConfig config,
| 74 GrLayerAtlas::GrLayerAtlas(GrTextureProvider* texProvider, GrPixelConfig config,
|
75 GrSurfaceFlags flags, | 75 GrSurfaceFlags flags, |
76 const SkISize& backingTextureSize, | 76 const SkISize& backingTextureSize, |
77 int numPlotsX, int numPlotsY) { | 77 int numPlotsX, int numPlotsY) { |
78 fTexProvider = texProvider; | 78 fTexProvider = texProvider; |
79 fPixelConfig = config; | 79 fPixelConfig = config; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 usage->appendPlot(plot); | 161 usage->appendPlot(plot); |
162 return plot; | 162 return plot; |
163 } | 163 } |
164 plotIter.next(); | 164 plotIter.next(); |
165 } | 165 } |
166 | 166 |
167 // If the above fails, then the current plot list has no room | 167 // If the above fails, then the current plot list has no room |
168 return nullptr; | 168 return nullptr; |
169 } | 169 } |
170 | 170 |
OLD | NEW |