Index: src/image/SkSurface_Gpu.cpp |
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp |
index fa006a61cdb4f7acf421a7fae3467ae70c063e80..c05fddafd0ebc562521dea85d7b37a60ad2d7b22 100644 |
--- a/src/image/SkSurface_Gpu.cpp |
+++ b/src/image/SkSurface_Gpu.cpp |
@@ -26,6 +26,19 @@ SkSurface_Gpu::~SkSurface_Gpu() { |
fDevice->unref(); |
} |
+GrBackendObject SkSurface_Gpu::onGetTextureHandle(ContentChangeMode mode) { |
Justin Novosad
2015/06/26 21:33:15
Where in this method does the genID get bumped? AP
reed1
2015/06/27 17:56:12
New enum supports read and write access.
We are n
|
+ GrRenderTarget* rt = fDevice->accessRenderTarget(); |
+ switch (mode) { |
+ case kDiscard_ContentChangeMode: |
+ rt->discard(); |
Justin Novosad
2015/06/26 21:33:15
What is the use case for this?
reed1
2015/06/27 17:56:12
Enum has changed, but the idea is to have 2 write
|
+ break; |
+ case kRetain_ContentChangeMode: |
+ rt->prepareForExternalRead(); // todo: rename to prepareForExternalAccess() |
+ break; |
+ } |
+ return rt->asTexture()->getTextureHandle(); |
+} |
+ |
SkCanvas* SkSurface_Gpu::onNewCanvas() { |
SkCanvas::InitFlags flags = SkCanvas::kDefault_InitFlags; |
// When we think this works... |