skia2/tools/CopyTilesRenderer.h
robertphillips ce4dd3de38 Split SkPicturePlayback out of SkPictureData
This splits the playback functionality out of SkPictureData. The old SkPictureData::draw method is pulled out along
with its supporting functions as verbatim as possible. Some follow on CLs will be required to:

   re-enable profiling in the debugger (and remove the vestiges of SkTimedPicture)
   re-enable display of command offsets in the picture (this should probably wait until we've switched to SkRecord though)
   Clean up CachedOperationList (maybe fuse with SkPicture::OperationList)
   Split SkPicturePlayback into a base class and two derived classes
   Implement parallel version of GatherGPUInfo for SkRecord

Landing this is blocked on removing Android's use of the abortPlayback entry point.

R=mtklein@google.com, reed@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/377623002
2014-07-07 13:46:35 -07:00

53 lines
1.5 KiB
C++

/*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef CopyTilesRenderer_DEFINED
#define CopyTilesRenderer_DEFINED
#include "PictureRenderer.h"
#include "SkTypes.h"
class SkPicture;
class SkString;
namespace sk_tools {
/**
* PictureRenderer that draws the picture and then extracts it into tiles. For large pictures,
* it will divide the picture into large tiles and draw the picture once for each large tile.
*/
class CopyTilesRenderer : public TiledPictureRenderer {
public:
CopyTilesRenderer(int x, int y);
virtual void init(const SkPicture* pict,
const SkString* writePath,
const SkString* mismatchPath,
const SkString* inputFilename,
bool useChecksumBasedFilenames) SK_OVERRIDE;
/**
* Similar to TiledPictureRenderer, this will draw a PNG for each tile. However, the
* numbering (and actual tiles) will be different.
*/
virtual bool render(SkBitmap** out) SK_OVERRIDE;
virtual bool supportsTimingIndividualTiles() SK_OVERRIDE { return false; }
private:
int fXTilesPerLargeTile;
int fYTilesPerLargeTile;
int fLargeTileWidth;
int fLargeTileHeight;
virtual SkString getConfigNameInternal() SK_OVERRIDE;
typedef TiledPictureRenderer INHERITED;
};
} // sk_tools
#endif // CopyTilesRenderer_DEFINED