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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 13211002: Make GM render to render targets that are also textures. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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
« no previous file with comments | « include/gpu/SkGpuDevice.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
===================================================================
--- src/gpu/SkGpuDevice.cpp (revision 8437)
+++ src/gpu/SkGpuDevice.cpp (working copy)
@@ -167,6 +167,18 @@
return bitmap;
}
+SkGpuDevice* SkGpuDevice::Create(GrSurface* surface) {
+ GrAssert(NULL != surface);
+ if (NULL == surface->asRenderTarget() || NULL == surface->getContext()) {
+ return NULL;
+ }
+ if (surface->asTexture()) {
+ return SkNEW_ARGS(SkGpuDevice, (surface->getContext(), surface->asTexture()));
+ } else {
+ return SkNEW_ARGS(SkGpuDevice, (surface->getContext(), surface->asRenderTarget()));
+ }
+}
+
SkGpuDevice::SkGpuDevice(GrContext* context, GrTexture* texture)
: SkDevice(make_bitmap(context, texture->asRenderTarget())) {
this->initFromRenderTarget(context, texture->asRenderTarget(), false);
« no previous file with comments | « include/gpu/SkGpuDevice.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698