OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 "GrContext.h" | 9 #include "GrContext.h" |
10 #include "GrDrawTargetCaps.h" | 10 #include "GrDrawTargetCaps.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 case GrTextureParams::kBilerp_FilterMode: | 95 case GrTextureParams::kBilerp_FilterMode: |
96 case GrTextureParams::kMipMap_FilterMode: | 96 case GrTextureParams::kMipMap_FilterMode: |
97 flags |= kBilerp_TextureFlag; | 97 flags |= kBilerp_TextureFlag; |
98 break; | 98 break; |
99 } | 99 } |
100 } | 100 } |
101 } | 101 } |
102 return flags; | 102 return flags; |
103 } | 103 } |
104 | 104 |
105 // FIXME: This should be refactored with the code in gl/GrGpuGL.cpp. | 105 // FIXME: This should be refactored with the code in gl/GrGLGpu.cpp. |
106 GrSurfaceOrigin resolve_origin(const GrSurfaceDesc& desc) { | 106 GrSurfaceOrigin resolve_origin(const GrSurfaceDesc& desc) { |
107 // By default, GrRenderTargets are GL's normal orientation so that they | 107 // By default, GrRenderTargets are GL's normal orientation so that they |
108 // can be drawn to by the outside world without the client having | 108 // can be drawn to by the outside world without the client having |
109 // to render upside down. | 109 // to render upside down. |
110 bool renderTarget = 0 != (desc.fFlags & kRenderTarget_GrSurfaceFlag); | 110 bool renderTarget = 0 != (desc.fFlags & kRenderTarget_GrSurfaceFlag); |
111 if (kDefault_GrSurfaceOrigin == desc.fOrigin) { | 111 if (kDefault_GrSurfaceOrigin == desc.fOrigin) { |
112 return renderTarget ? kBottomLeft_GrSurfaceOrigin : kTopLeft_GrSurfaceOr
igin; | 112 return renderTarget ? kBottomLeft_GrSurfaceOrigin : kTopLeft_GrSurfaceOr
igin; |
113 } else { | 113 } else { |
114 return desc.fOrigin; | 114 return desc.fOrigin; |
115 } | 115 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 return GrResourceKey(cacheID, ResourceType(), 0); | 156 return GrResourceKey(cacheID, ResourceType(), 0); |
157 } | 157 } |
158 | 158 |
159 bool GrTexturePriv::NeedsResizing(const GrResourceKey& key) { | 159 bool GrTexturePriv::NeedsResizing(const GrResourceKey& key) { |
160 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); | 160 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); |
161 } | 161 } |
162 | 162 |
163 bool GrTexturePriv::NeedsBilerp(const GrResourceKey& key) { | 163 bool GrTexturePriv::NeedsBilerp(const GrResourceKey& key) { |
164 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); | 164 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); |
165 } | 165 } |
OLD | NEW |