reed@google.com | c906204 | 2012-07-30 18:06:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
Mike Klein | 0ec1c57 | 2018-12-04 11:52:51 -0500 | [diff] [blame] | 8 | #include "GrBackendSurface.h" |
reed@google.com | 889b09e | 2012-07-27 21:10:42 +0000 | [diff] [blame] | 9 | #include "SkCanvas.h" |
reed | 4a8126e | 2014-09-22 07:29:03 -0700 | [diff] [blame] | 10 | #include "SkFontLCDConfig.h" |
Robert Phillips | 8caf85f | 2018-04-05 09:30:38 -0400 | [diff] [blame] | 11 | #include "SkImagePriv.h" |
| 12 | #include "SkSurface_Base.h" |
Mike Klein | 0ec1c57 | 2018-12-04 11:52:51 -0500 | [diff] [blame] | 13 | #include <atomic> |
Robert Phillips | 8caf85f | 2018-04-05 09:30:38 -0400 | [diff] [blame] | 14 | |
reed | 4a8126e | 2014-09-22 07:29:03 -0700 | [diff] [blame] | 15 | static SkPixelGeometry compute_default_geometry() { |
| 16 | SkFontLCDConfig::LCDOrder order = SkFontLCDConfig::GetSubpixelOrder(); |
| 17 | if (SkFontLCDConfig::kNONE_LCDOrder == order) { |
| 18 | return kUnknown_SkPixelGeometry; |
| 19 | } else { |
| 20 | // Bit0 is RGB(0), BGR(1) |
| 21 | // Bit1 is H(0), V(1) |
| 22 | const SkPixelGeometry gGeo[] = { |
| 23 | kRGB_H_SkPixelGeometry, |
| 24 | kBGR_H_SkPixelGeometry, |
| 25 | kRGB_V_SkPixelGeometry, |
| 26 | kBGR_V_SkPixelGeometry, |
| 27 | }; |
| 28 | int index = 0; |
| 29 | if (SkFontLCDConfig::kBGR_LCDOrder == order) { |
| 30 | index |= 1; |
| 31 | } |
| 32 | if (SkFontLCDConfig::kVertical_LCDOrientation == SkFontLCDConfig::GetSubpixelOrientation()){ |
| 33 | index |= 2; |
| 34 | } |
| 35 | return gGeo[index]; |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | SkSurfaceProps::SkSurfaceProps() : fFlags(0), fPixelGeometry(kUnknown_SkPixelGeometry) {} |
| 40 | |
| 41 | SkSurfaceProps::SkSurfaceProps(InitType) : fFlags(0), fPixelGeometry(compute_default_geometry()) {} |
| 42 | |
| 43 | SkSurfaceProps::SkSurfaceProps(uint32_t flags, InitType) |
| 44 | : fFlags(flags) |
| 45 | , fPixelGeometry(compute_default_geometry()) |
| 46 | {} |
| 47 | |
| 48 | SkSurfaceProps::SkSurfaceProps(uint32_t flags, SkPixelGeometry pg) |
| 49 | : fFlags(flags), fPixelGeometry(pg) |
| 50 | {} |
| 51 | |
reed | 4af267b | 2014-11-21 08:46:37 -0800 | [diff] [blame] | 52 | SkSurfaceProps::SkSurfaceProps(const SkSurfaceProps& other) |
| 53 | : fFlags(other.fFlags) |
| 54 | , fPixelGeometry(other.fPixelGeometry) |
| 55 | {} |
| 56 | |
reed@google.com | 889b09e | 2012-07-27 21:10:42 +0000 | [diff] [blame] | 57 | /////////////////////////////////////////////////////////////////////////////// |
| 58 | |
reed | 4a8126e | 2014-09-22 07:29:03 -0700 | [diff] [blame] | 59 | SkSurface_Base::SkSurface_Base(int width, int height, const SkSurfaceProps* props) |
Robert Phillips | a54ccb2 | 2017-01-31 07:40:33 -0500 | [diff] [blame] | 60 | : INHERITED(width, height, props) { |
reed@google.com | 9ea5a3b | 2012-07-30 21:03:46 +0000 | [diff] [blame] | 61 | } |
reed@google.com | 889b09e | 2012-07-27 21:10:42 +0000 | [diff] [blame] | 62 | |
reed | 4a8126e | 2014-09-22 07:29:03 -0700 | [diff] [blame] | 63 | SkSurface_Base::SkSurface_Base(const SkImageInfo& info, const SkSurfaceProps* props) |
Robert Phillips | a54ccb2 | 2017-01-31 07:40:33 -0500 | [diff] [blame] | 64 | : INHERITED(info, props) { |
reed@google.com | 1360c52 | 2014-01-08 21:25:26 +0000 | [diff] [blame] | 65 | } |
| 66 | |
reed@google.com | 9ea5a3b | 2012-07-30 21:03:46 +0000 | [diff] [blame] | 67 | SkSurface_Base::~SkSurface_Base() { |
reed@google.com | 97af1a6 | 2012-08-28 12:19:02 +0000 | [diff] [blame] | 68 | // in case the canvas outsurvives us, we null the callback |
| 69 | if (fCachedCanvas) { |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 70 | fCachedCanvas->setSurfaceBase(nullptr); |
reed@google.com | 97af1a6 | 2012-08-28 12:19:02 +0000 | [diff] [blame] | 71 | } |
reed@google.com | 9ea5a3b | 2012-07-30 21:03:46 +0000 | [diff] [blame] | 72 | } |
reed@google.com | 889b09e | 2012-07-27 21:10:42 +0000 | [diff] [blame] | 73 | |
Robert Phillips | 8caf85f | 2018-04-05 09:30:38 -0400 | [diff] [blame] | 74 | GrBackendTexture SkSurface_Base::onGetBackendTexture(BackendHandleAccess) { |
| 75 | return GrBackendTexture(); // invalid |
| 76 | } |
| 77 | |
| 78 | GrBackendRenderTarget SkSurface_Base::onGetBackendRenderTarget(BackendHandleAccess) { |
| 79 | return GrBackendRenderTarget(); // invalid |
| 80 | } |
| 81 | |
reed | 4a8126e | 2014-09-22 07:29:03 -0700 | [diff] [blame] | 82 | void SkSurface_Base::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint) { |
Robert Phillips | ac6b1fa | 2017-03-20 08:38:50 -0400 | [diff] [blame] | 83 | auto image = this->makeImageSnapshot(); |
reed@google.com | 889b09e | 2012-07-27 21:10:42 +0000 | [diff] [blame] | 84 | if (image) { |
piotaixr | b5fae93 | 2014-09-24 13:03:30 -0700 | [diff] [blame] | 85 | canvas->drawImage(image, x, y, paint); |
reed@google.com | 889b09e | 2012-07-27 21:10:42 +0000 | [diff] [blame] | 86 | } |
| 87 | } |
| 88 | |
reed | c83a297 | 2015-07-16 07:40:45 -0700 | [diff] [blame] | 89 | bool SkSurface_Base::outstandingImageSnapshot() const { |
| 90 | return fCachedImage && !fCachedImage->unique(); |
| 91 | } |
| 92 | |
commit-bot@chromium.org | c4c9870 | 2013-04-22 14:28:01 +0000 | [diff] [blame] | 93 | void SkSurface_Base::aboutToDraw(ContentChangeMode mode) { |
reed@google.com | 97af1a6 | 2012-08-28 12:19:02 +0000 | [diff] [blame] | 94 | this->dirtyGenerationID(); |
| 95 | |
commit-bot@chromium.org | 28361fa | 2014-03-28 16:08:05 +0000 | [diff] [blame] | 96 | SkASSERT(!fCachedCanvas || fCachedCanvas->getSurfaceBase() == this); |
reed@google.com | 97af1a6 | 2012-08-28 12:19:02 +0000 | [diff] [blame] | 97 | |
bsalomon | 49f085d | 2014-09-05 13:34:00 -0700 | [diff] [blame] | 98 | if (fCachedImage) { |
reed@google.com | 97af1a6 | 2012-08-28 12:19:02 +0000 | [diff] [blame] | 99 | // the surface may need to fork its backend, if its sharing it with |
| 100 | // the cached image. Note: we only call if there is an outstanding owner |
| 101 | // on the image (besides us). |
reed | 26e0e58 | 2015-07-29 11:44:52 -0700 | [diff] [blame] | 102 | bool unique = fCachedImage->unique(); |
| 103 | if (!unique) { |
commit-bot@chromium.org | c4c9870 | 2013-04-22 14:28:01 +0000 | [diff] [blame] | 104 | this->onCopyOnWrite(mode); |
reed@google.com | 97af1a6 | 2012-08-28 12:19:02 +0000 | [diff] [blame] | 105 | } |
| 106 | |
| 107 | // regardless of copy-on-write, we must drop our cached image now, so |
| 108 | // that the next request will get our new contents. |
Robert Phillips | a54ccb2 | 2017-01-31 07:40:33 -0500 | [diff] [blame] | 109 | fCachedImage.reset(); |
reed | 26e0e58 | 2015-07-29 11:44:52 -0700 | [diff] [blame] | 110 | |
| 111 | if (unique) { |
| 112 | // Our content isn't held by any image now, so we can consider that content mutable. |
| 113 | // Raster surfaces need to be told it's safe to consider its pixels mutable again. |
| 114 | // We make this call after the ->unref() so the subclass can assert there are no images. |
| 115 | this->onRestoreBackingMutability(); |
| 116 | } |
commit-bot@chromium.org | 28361fa | 2014-03-28 16:08:05 +0000 | [diff] [blame] | 117 | } else if (kDiscard_ContentChangeMode == mode) { |
| 118 | this->onDiscard(); |
reed@google.com | 97af1a6 | 2012-08-28 12:19:02 +0000 | [diff] [blame] | 119 | } |
| 120 | } |
| 121 | |
| 122 | uint32_t SkSurface_Base::newGenerationID() { |
commit-bot@chromium.org | 28361fa | 2014-03-28 16:08:05 +0000 | [diff] [blame] | 123 | SkASSERT(!fCachedCanvas || fCachedCanvas->getSurfaceBase() == this); |
Mike Klein | 0ec1c57 | 2018-12-04 11:52:51 -0500 | [diff] [blame] | 124 | static std::atomic<uint32_t> nextID{1}; |
| 125 | return nextID++; |
reed@google.com | 97af1a6 | 2012-08-28 12:19:02 +0000 | [diff] [blame] | 126 | } |
| 127 | |
reed@google.com | 889b09e | 2012-07-27 21:10:42 +0000 | [diff] [blame] | 128 | static SkSurface_Base* asSB(SkSurface* surface) { |
| 129 | return static_cast<SkSurface_Base*>(surface); |
| 130 | } |
| 131 | |
| 132 | /////////////////////////////////////////////////////////////////////////////// |
| 133 | |
reed | 4a8126e | 2014-09-22 07:29:03 -0700 | [diff] [blame] | 134 | SkSurface::SkSurface(int width, int height, const SkSurfaceProps* props) |
| 135 | : fProps(SkSurfacePropsCopyOrDefault(props)), fWidth(width), fHeight(height) |
| 136 | { |
reed | b2497c2 | 2014-12-31 12:31:43 -0800 | [diff] [blame] | 137 | SkASSERT(fWidth > 0); |
| 138 | SkASSERT(fHeight > 0); |
reed@google.com | 1360c52 | 2014-01-08 21:25:26 +0000 | [diff] [blame] | 139 | fGenerationID = 0; |
| 140 | } |
| 141 | |
reed | 4a8126e | 2014-09-22 07:29:03 -0700 | [diff] [blame] | 142 | SkSurface::SkSurface(const SkImageInfo& info, const SkSurfaceProps* props) |
| 143 | : fProps(SkSurfacePropsCopyOrDefault(props)), fWidth(info.width()), fHeight(info.height()) |
| 144 | { |
reed | b2497c2 | 2014-12-31 12:31:43 -0800 | [diff] [blame] | 145 | SkASSERT(fWidth > 0); |
| 146 | SkASSERT(fHeight > 0); |
reed@google.com | 889b09e | 2012-07-27 21:10:42 +0000 | [diff] [blame] | 147 | fGenerationID = 0; |
| 148 | } |
| 149 | |
reed@google.com | 97af1a6 | 2012-08-28 12:19:02 +0000 | [diff] [blame] | 150 | uint32_t SkSurface::generationID() { |
| 151 | if (0 == fGenerationID) { |
| 152 | fGenerationID = asSB(this)->newGenerationID(); |
| 153 | } |
| 154 | return fGenerationID; |
| 155 | } |
| 156 | |
commit-bot@chromium.org | c4c9870 | 2013-04-22 14:28:01 +0000 | [diff] [blame] | 157 | void SkSurface::notifyContentWillChange(ContentChangeMode mode) { |
| 158 | asSB(this)->aboutToDraw(mode); |
reed@google.com | 97af1a6 | 2012-08-28 12:19:02 +0000 | [diff] [blame] | 159 | } |
| 160 | |
reed@google.com | 9ea5a3b | 2012-07-30 21:03:46 +0000 | [diff] [blame] | 161 | SkCanvas* SkSurface::getCanvas() { |
| 162 | return asSB(this)->getCachedCanvas(); |
reed@google.com | 889b09e | 2012-07-27 21:10:42 +0000 | [diff] [blame] | 163 | } |
| 164 | |
Robert Phillips | ac6b1fa | 2017-03-20 08:38:50 -0400 | [diff] [blame] | 165 | sk_sp<SkImage> SkSurface::makeImageSnapshot() { |
| 166 | return asSB(this)->refCachedImage(); |
reed@google.com | 889b09e | 2012-07-27 21:10:42 +0000 | [diff] [blame] | 167 | } |
| 168 | |
Mike Reed | 114bde8 | 2018-11-21 09:12:09 -0500 | [diff] [blame] | 169 | sk_sp<SkImage> SkSurface::makeImageSnapshot(const SkIRect& srcBounds) { |
| 170 | const SkIRect surfBounds = { 0, 0, fWidth, fHeight }; |
| 171 | SkIRect bounds = srcBounds; |
| 172 | if (!bounds.intersect(surfBounds)) { |
| 173 | return nullptr; |
| 174 | } |
| 175 | SkASSERT(!bounds.isEmpty()); |
| 176 | if (bounds == surfBounds) { |
| 177 | return this->makeImageSnapshot(); |
| 178 | } else { |
| 179 | return asSB(this)->onNewImageSnapshot(&bounds); |
| 180 | } |
| 181 | } |
| 182 | |
reed | e8f3062 | 2016-03-23 18:59:25 -0700 | [diff] [blame] | 183 | sk_sp<SkSurface> SkSurface::makeSurface(const SkImageInfo& info) { |
mike@reedtribe.org | b947625 | 2012-11-15 02:37:45 +0000 | [diff] [blame] | 184 | return asSB(this)->onNewSurface(info); |
reed@google.com | 889b09e | 2012-07-27 21:10:42 +0000 | [diff] [blame] | 185 | } |
| 186 | |
| 187 | void SkSurface::draw(SkCanvas* canvas, SkScalar x, SkScalar y, |
| 188 | const SkPaint* paint) { |
| 189 | return asSB(this)->onDraw(canvas, x, y, paint); |
| 190 | } |
commit-bot@chromium.org | c3bd8af | 2014-02-13 17:14:46 +0000 | [diff] [blame] | 191 | |
reed | 6ceeebd | 2016-03-09 14:26:26 -0800 | [diff] [blame] | 192 | bool SkSurface::peekPixels(SkPixmap* pmap) { |
| 193 | return this->getCanvas()->peekPixels(pmap); |
commit-bot@chromium.org | c3bd8af | 2014-02-13 17:14:46 +0000 | [diff] [blame] | 194 | } |
reed | 4a8126e | 2014-09-22 07:29:03 -0700 | [diff] [blame] | 195 | |
Mike Reed | 353196f | 2017-07-21 11:01:18 -0400 | [diff] [blame] | 196 | bool SkSurface::readPixels(const SkPixmap& pm, int srcX, int srcY) { |
| 197 | return this->getCanvas()->readPixels(pm, srcX, srcY); |
| 198 | } |
| 199 | |
reed | 7543aa2 | 2014-12-09 14:39:44 -0800 | [diff] [blame] | 200 | bool SkSurface::readPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, |
| 201 | int srcX, int srcY) { |
Mike Reed | 353196f | 2017-07-21 11:01:18 -0400 | [diff] [blame] | 202 | return this->readPixels({dstInfo, dstPixels, dstRowBytes}, srcX, srcY); |
| 203 | } |
| 204 | |
| 205 | bool SkSurface::readPixels(const SkBitmap& bitmap, int srcX, int srcY) { |
| 206 | SkPixmap pm; |
| 207 | return bitmap.peekPixels(&pm) && this->readPixels(pm, srcX, srcY); |
reed | 7543aa2 | 2014-12-09 14:39:44 -0800 | [diff] [blame] | 208 | } |
| 209 | |
Mike Reed | 4c790bd | 2018-02-08 14:10:40 -0500 | [diff] [blame] | 210 | void SkSurface::writePixels(const SkPixmap& pmap, int x, int y) { |
| 211 | if (pmap.addr() == nullptr || pmap.width() <= 0 || pmap.height() <= 0) { |
| 212 | return; |
| 213 | } |
| 214 | |
| 215 | const SkIRect srcR = SkIRect::MakeXYWH(x, y, pmap.width(), pmap.height()); |
| 216 | const SkIRect dstR = SkIRect::MakeWH(this->width(), this->height()); |
| 217 | if (SkIRect::Intersects(srcR, dstR)) { |
| 218 | ContentChangeMode mode = kRetain_ContentChangeMode; |
| 219 | if (srcR.contains(dstR)) { |
| 220 | mode = kDiscard_ContentChangeMode; |
| 221 | } |
| 222 | asSB(this)->aboutToDraw(mode); |
| 223 | asSB(this)->onWritePixels(pmap, x, y); |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | void SkSurface::writePixels(const SkBitmap& src, int x, int y) { |
| 228 | SkPixmap pm; |
| 229 | if (src.peekPixels(&pm)) { |
| 230 | this->writePixels(pm, x, y); |
| 231 | } |
| 232 | } |
| 233 | |
Robert Phillips | 8caf85f | 2018-04-05 09:30:38 -0400 | [diff] [blame] | 234 | GrBackendTexture SkSurface::getBackendTexture(BackendHandleAccess access) { |
| 235 | return asSB(this)->onGetBackendTexture(access); |
| 236 | } |
| 237 | |
| 238 | GrBackendRenderTarget SkSurface::getBackendRenderTarget(BackendHandleAccess access) { |
| 239 | return asSB(this)->onGetBackendRenderTarget(access); |
| 240 | } |
Robert Phillips | 8caf85f | 2018-04-05 09:30:38 -0400 | [diff] [blame] | 241 | |
ericrk | f7b8b8a | 2016-02-24 14:49:51 -0800 | [diff] [blame] | 242 | void SkSurface::prepareForExternalIO() { |
Greg Daniel | a5cb781 | 2017-06-16 09:45:32 -0400 | [diff] [blame] | 243 | this->flush(); |
| 244 | } |
| 245 | |
| 246 | void SkSurface::flush() { |
| 247 | asSB(this)->onFlush(0, nullptr); |
| 248 | } |
| 249 | |
Greg Daniel | 5131678 | 2017-08-02 15:10:09 +0000 | [diff] [blame] | 250 | GrSemaphoresSubmitted SkSurface::flushAndSignalSemaphores(int numSemaphores, |
| 251 | GrBackendSemaphore signalSemaphores[]) { |
Greg Daniel | a5cb781 | 2017-06-16 09:45:32 -0400 | [diff] [blame] | 252 | return asSB(this)->onFlush(numSemaphores, signalSemaphores); |
| 253 | } |
| 254 | |
Greg Daniel | c64ee46 | 2017-06-15 16:59:49 -0400 | [diff] [blame] | 255 | bool SkSurface::wait(int numSemaphores, const GrBackendSemaphore* waitSemaphores) { |
| 256 | return asSB(this)->onWait(numSemaphores, waitSemaphores); |
ericrk | f7b8b8a | 2016-02-24 14:49:51 -0800 | [diff] [blame] | 257 | } |
| 258 | |
Robert Phillips | ad8a43f | 2017-08-30 12:06:35 -0400 | [diff] [blame] | 259 | bool SkSurface::characterize(SkSurfaceCharacterization* characterization) const { |
| 260 | return asSB(const_cast<SkSurface*>(this))->onCharacterize(characterization); |
| 261 | } |
| 262 | |
Robert Phillips | 7ffbcf9 | 2017-12-04 12:52:46 -0500 | [diff] [blame] | 263 | bool SkSurface::draw(SkDeferredDisplayList* ddl) { |
Robert Phillips | ad8a43f | 2017-08-30 12:06:35 -0400 | [diff] [blame] | 264 | return asSB(this)->onDraw(ddl); |
| 265 | } |
| 266 | |
reed | 4a8126e | 2014-09-22 07:29:03 -0700 | [diff] [blame] | 267 | ////////////////////////////////////////////////////////////////////////////////////// |
Mike Reed | 44d04bd | 2017-06-28 19:57:21 -0400 | [diff] [blame] | 268 | #include "SkNoDrawCanvas.h" |
| 269 | |
| 270 | class SkNullSurface : public SkSurface_Base { |
| 271 | public: |
| 272 | SkNullSurface(int width, int height) : SkSurface_Base(width, height, nullptr) {} |
| 273 | |
| 274 | protected: |
| 275 | SkCanvas* onNewCanvas() override { |
| 276 | return new SkNoDrawCanvas(this->width(), this->height()); |
| 277 | } |
| 278 | sk_sp<SkSurface> onNewSurface(const SkImageInfo& info) override { |
| 279 | return MakeNull(info.width(), info.height()); |
| 280 | } |
Mike Reed | 114bde8 | 2018-11-21 09:12:09 -0500 | [diff] [blame] | 281 | sk_sp<SkImage> onNewImageSnapshot(const SkIRect* subsetOrNull) override { return nullptr; } |
Mike Reed | 4c790bd | 2018-02-08 14:10:40 -0500 | [diff] [blame] | 282 | void onWritePixels(const SkPixmap&, int x, int y) override {} |
Mike Reed | 44d04bd | 2017-06-28 19:57:21 -0400 | [diff] [blame] | 283 | void onDraw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) override {} |
| 284 | void onCopyOnWrite(ContentChangeMode) override {} |
| 285 | }; |
| 286 | |
| 287 | sk_sp<SkSurface> SkSurface::MakeNull(int width, int height) { |
| 288 | if (width < 1 || height < 1) { |
| 289 | return nullptr; |
| 290 | } |
| 291 | return sk_sp<SkSurface>(new SkNullSurface(width, height)); |
| 292 | } |
| 293 | |
| 294 | ////////////////////////////////////////////////////////////////////////////////////// |
reed | 4a8126e | 2014-09-22 07:29:03 -0700 | [diff] [blame] | 295 | |
| 296 | #if !SK_SUPPORT_GPU |
| 297 | |
Brian Salomon | bdecacf | 2018-02-02 20:32:49 -0500 | [diff] [blame] | 298 | sk_sp<SkSurface> SkSurface::MakeRenderTarget(GrContext*, SkBudgeted, const SkImageInfo&, int, |
| 299 | GrSurfaceOrigin, const SkSurfaceProps*, bool) { |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 300 | return nullptr; |
reed | 4a8126e | 2014-09-22 07:29:03 -0700 | [diff] [blame] | 301 | } |
| 302 | |
Robert Phillips | 6b6fcc7 | 2018-03-30 13:57:00 -0400 | [diff] [blame] | 303 | sk_sp<SkSurface> SkSurface::MakeRenderTarget(GrContext*, const SkSurfaceCharacterization&, |
| 304 | SkBudgeted) { |
| 305 | return nullptr; |
| 306 | } |
| 307 | |
Greg Daniel | 9440345 | 2017-04-18 15:52:36 -0400 | [diff] [blame] | 308 | sk_sp<SkSurface> SkSurface::MakeFromBackendTexture(GrContext*, const GrBackendTexture&, |
| 309 | GrSurfaceOrigin origin, int sampleCnt, |
Greg Daniel | faa095e | 2017-12-19 13:15:02 -0500 | [diff] [blame] | 310 | SkColorType, sk_sp<SkColorSpace>, |
Greg Daniel | 8ce7991 | 2019-02-05 10:08:43 -0500 | [diff] [blame] | 311 | const SkSurfaceProps*, |
| 312 | TextureReleaseProc, ReleaseContext) { |
Greg Daniel | faa095e | 2017-12-19 13:15:02 -0500 | [diff] [blame] | 313 | return nullptr; |
| 314 | } |
| 315 | |
reed | e8f3062 | 2016-03-23 18:59:25 -0700 | [diff] [blame] | 316 | sk_sp<SkSurface> SkSurface::MakeFromBackendRenderTarget(GrContext*, |
Greg Daniel | 9440345 | 2017-04-18 15:52:36 -0400 | [diff] [blame] | 317 | const GrBackendRenderTarget&, |
| 318 | GrSurfaceOrigin origin, |
Greg Daniel | faa095e | 2017-12-19 13:15:02 -0500 | [diff] [blame] | 319 | SkColorType, |
| 320 | sk_sp<SkColorSpace>, |
Greg Daniel | 8ce7991 | 2019-02-05 10:08:43 -0500 | [diff] [blame] | 321 | const SkSurfaceProps*, |
| 322 | RenderTargetReleaseProc, ReleaseContext) { |
Greg Daniel | faa095e | 2017-12-19 13:15:02 -0500 | [diff] [blame] | 323 | return nullptr; |
| 324 | } |
| 325 | |
Greg Daniel | 9440345 | 2017-04-18 15:52:36 -0400 | [diff] [blame] | 326 | sk_sp<SkSurface> SkSurface::MakeFromBackendTextureAsRenderTarget(GrContext*, |
Greg Daniel | 9440345 | 2017-04-18 15:52:36 -0400 | [diff] [blame] | 327 | const GrBackendTexture&, |
| 328 | GrSurfaceOrigin origin, |
| 329 | int sampleCnt, |
Greg Daniel | faa095e | 2017-12-19 13:15:02 -0500 | [diff] [blame] | 330 | SkColorType, |
| 331 | sk_sp<SkColorSpace>, |
| 332 | const SkSurfaceProps*) { |
| 333 | return nullptr; |
| 334 | } |
| 335 | |
reed | 4a8126e | 2014-09-22 07:29:03 -0700 | [diff] [blame] | 336 | #endif |