From af951c9bc4cbb6e60b430194fe5127ebe99c53fb Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Thu, 16 Jun 2011 19:10:39 +0000 Subject: make SkDevice constructors explicit between offscreen and on/direct http://codereview.appspot.com/4632044/ git-svn-id: http://skia.googlecode.com/svn/trunk@1620 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/gpu/SkGpuDevice.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'include/gpu/SkGpuDevice.h') diff --git a/include/gpu/SkGpuDevice.h b/include/gpu/SkGpuDevice.h index 96afa082ff..4d0efeb511 100644 --- a/include/gpu/SkGpuDevice.h +++ b/include/gpu/SkGpuDevice.h @@ -19,6 +19,7 @@ #define SkGpuDevice_DEFINED #include "SkGr.h" +#include "SkBitmap.h" #include "SkDevice.h" #include "SkRegion.h" @@ -33,15 +34,19 @@ class GrTextContext; class SK_API SkGpuDevice : public SkDevice { public: /** - * The SkGpuDevice will render to the GrRenderTarget, or if the paremeter is - * null it will create its own render target and manage that target's - * lifetime. Setting isSaveLayer to true is for internal use and may cause - * problems when using the device's bitmap as a src if used externally. + * New device that will create an offscreen renderTarget based on the + * config, width, height. + * + * isForSaveLayer is a special flag that should only be set by SkCanvas + * internally. */ - SkGpuDevice(GrContext*, - const SkBitmap& bitmap, - GrRenderTarget* renderTargetOrNull, - bool isSaveLayer = false); + SkGpuDevice(GrContext*, SkBitmap::Config, int width, int height, + bool isForSaveLayer = false); + + /** + * New device that will render to the specified renderTarget. + */ + SkGpuDevice(GrContext*, GrRenderTarget*); /** * Magic value that can be passed to constructor. Causes -- cgit v1.2.3