Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: src/image/SkSurface_Gpu.cpp

Issue 1210303003: add getTextureHandle to SkSurface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« include/core/SkSurface.h ('K') | « src/image/SkSurface_Gpu.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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...
« include/core/SkSurface.h ('K') | « src/image/SkSurface_Gpu.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698