OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkData.h" | 10 #include "SkData.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 } | 115 } |
116 | 116 |
117 #if SK_SUPPORT_GPU | 117 #if SK_SUPPORT_GPU |
118 | 118 |
119 GrTexture* SkImage::getTexture() const { | 119 GrTexture* SkImage::getTexture() const { |
120 return as_IB(this)->getTexture(); | 120 return as_IB(this)->getTexture(); |
121 } | 121 } |
122 | 122 |
123 bool SkImage::isTextureBacked() const { return SkToBool(as_IB(this)->getTexture(
)); } | 123 bool SkImage::isTextureBacked() const { return SkToBool(as_IB(this)->getTexture(
)); } |
124 | 124 |
125 GrBackendObject SkImage::getTextureHandle(bool flushPendingGrContextReads) const
{ | 125 GrBackendObject SkImage::getTextureHandle(bool flushPendingGrContextIO) const { |
126 GrTexture* texture = as_IB(this)->getTexture(); | 126 GrTexture* texture = as_IB(this)->getTexture(); |
127 if (texture) { | 127 if (texture) { |
128 GrContext* context = texture->getContext(); | 128 GrContext* context = texture->getContext(); |
129 if (context) { | 129 if (context) { |
130 if (flushPendingGrContextReads) { | 130 if (flushPendingGrContextIO) { |
131 context->prepareSurfaceForExternalRead(texture); | 131 context->prepareSurfaceForExternalIO(texture); |
132 } | 132 } |
133 } | 133 } |
134 return texture->getTextureHandle(); | 134 return texture->getTextureHandle(); |
135 } | 135 } |
136 return 0; | 136 return 0; |
137 } | 137 } |
138 | 138 |
139 #else | 139 #else |
140 | 140 |
141 GrTexture* SkImage::getTexture() const { return NULL; } | 141 GrTexture* SkImage::getTexture() const { return NULL; } |
142 | 142 |
143 bool SkImage::isTextureBacked() const { return false; } | 143 bool SkImage::isTextureBacked() const { return false; } |
144 | 144 |
145 GrBackendObject SkImage::getTextureHandle(bool flushPendingGrContextReads) const
{ return 0; } | 145 GrBackendObject SkImage::getTextureHandle(bool) const { return 0; } |
146 | 146 |
147 #endif | 147 #endif |
148 | 148 |
149 /////////////////////////////////////////////////////////////////////////////// | 149 /////////////////////////////////////////////////////////////////////////////// |
150 | 150 |
151 static bool raster_canvas_supports(const SkImageInfo& info) { | 151 static bool raster_canvas_supports(const SkImageInfo& info) { |
152 switch (info.colorType()) { | 152 switch (info.colorType()) { |
153 case kN32_SkColorType: | 153 case kN32_SkColorType: |
154 return kUnpremul_SkAlphaType != info.alphaType(); | 154 return kUnpremul_SkAlphaType != info.alphaType(); |
155 case kRGB_565_SkColorType: | 155 case kRGB_565_SkColorType: |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 236 |
237 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&,
SkAlphaType) { | 237 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&,
SkAlphaType) { |
238 return NULL; | 238 return NULL; |
239 } | 239 } |
240 | 240 |
241 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk
AlphaType) { | 241 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk
AlphaType) { |
242 return NULL; | 242 return NULL; |
243 } | 243 } |
244 | 244 |
245 #endif | 245 #endif |
OLD | NEW |