diff options
Diffstat (limited to 'gpu/GrPictureUtils.cpp')
-rw-r--r-- | gpu/GrPictureUtils.cpp | 43 |
1 files changed, 4 insertions, 39 deletions
diff --git a/gpu/GrPictureUtils.cpp b/gpu/GrPictureUtils.cpp index d8e4161c..e8c3b504 100644 --- a/gpu/GrPictureUtils.cpp +++ b/gpu/GrPictureUtils.cpp @@ -7,8 +7,6 @@ #include "GrPictureUtils.h" #include "SkDevice.h" -#include "SkDraw.h" -#include "SkPaintPriv.h" // The GrGather device performs GPU-backend-specific preprocessing on // a picture. The results are stored in a GPUAccelData. @@ -22,17 +20,12 @@ class GrGatherDevice : public SkBaseDevice { public: SK_DECLARE_INST_COUNT(GrGatherDevice) - GrGatherDevice(int width, int height, SkPicture* picture, GPUAccelData* accelData, - int saveLayerDepth) { + GrGatherDevice(int width, int height, SkPicture* picture, GPUAccelData* accelData) { fPicture = picture; - fSaveLayerDepth = saveLayerDepth; - fInfo.fValid = true; fInfo.fSize.set(width, height); - fInfo.fPaint = NULL; fInfo.fSaveLayerOpID = fPicture->EXPERIMENTAL_curOpID(); fInfo.fRestoreOpID = 0; fInfo.fHasNestedLayers = false; - fInfo.fIsNested = (2 == fSaveLayerDepth); fEmptyBitmap.setConfig(SkImageInfo::Make(fInfo.fSize.fWidth, fInfo.fSize.fHeight, @@ -117,8 +110,7 @@ protected: const SkPaint& paint) SK_OVERRIDE { } virtual void drawDevice(const SkDraw& draw, SkBaseDevice* deviceIn, int x, int y, - const SkPaint& paint) SK_OVERRIDE { - // deviceIn is the one that is being "restored" back to its parent + const SkPaint&) SK_OVERRIDE { GrGatherDevice* device = static_cast<GrGatherDevice*>(deviceIn); if (device->fAlreadyDrawn) { @@ -126,29 +118,6 @@ protected: } device->fInfo.fRestoreOpID = fPicture->EXPERIMENTAL_curOpID(); - device->fInfo.fCTM = *draw.fMatrix; - device->fInfo.fCTM.postTranslate(SkIntToScalar(-device->getOrigin().fX), - SkIntToScalar(-device->getOrigin().fY)); - - // We need the x & y values that will yield 'getOrigin' when transformed - // by 'draw.fMatrix'. - device->fInfo.fOffset.iset(device->getOrigin()); - - SkMatrix invMatrix; - if (draw.fMatrix->invert(&invMatrix)) { - invMatrix.mapPoints(&device->fInfo.fOffset, 1); - } else { - device->fInfo.fValid = false; - } - - if (NeedsDeepCopy(paint)) { - // This NULL acts as a signal that the paint was uncopyable (for now) - device->fInfo.fPaint = NULL; - device->fInfo.fValid = false; - } else { - device->fInfo.fPaint = SkNEW_ARGS(SkPaint, (paint)); - } - fAccelData->addSaveLayerInfo(device->fInfo); device->fAlreadyDrawn = true; } @@ -189,9 +158,6 @@ private: // The information regarding the saveLayer call this device represents. GPUAccelData::SaveLayerInfo fInfo; - // The depth of this device in the saveLayer stack - int fSaveLayerDepth; - virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) SK_OVERRIDE { NotSupported(); } @@ -201,8 +167,7 @@ private: SkASSERT(kSaveLayer_Usage == usage); fInfo.fHasNestedLayers = true; - return SkNEW_ARGS(GrGatherDevice, (info.width(), info.height(), fPicture, - fAccelData, fSaveLayerDepth+1)); + return SkNEW_ARGS(GrGatherDevice, (info.width(), info.height(), fPicture, fAccelData)); } virtual void flush() SK_OVERRIDE {} @@ -274,7 +239,7 @@ void GatherGPUInfo(SkPicture* pict, GPUAccelData* accelData) { return ; } - GrGatherDevice device(pict->width(), pict->height(), pict, accelData, 0); + GrGatherDevice device(pict->width(), pict->height(), pict, accelData); GrGatherCanvas canvas(&device, pict); canvas.gather(); |