зеркало из https://github.com/mozilla/moz-skia.git
Revert r2250 - removal of setMatrixClip() - because Chrome makes heavy use
of those functions in a way we're not yet ready to clean up. git-svn-id: http://skia.googlecode.com/svn/trunk@2254 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
f2068adc2c
Коммит
8a0b0291ae
|
@ -73,14 +73,14 @@ public:
|
||||||
kVector_Capability = 0x2, //!< mask indicating a vector representation
|
kVector_Capability = 0x2, //!< mask indicating a vector representation
|
||||||
kAll_Capabilities = 0x3
|
kAll_Capabilities = 0x3
|
||||||
};
|
};
|
||||||
virtual uint32_t getDeviceCapabilities();
|
virtual uint32_t getDeviceCapabilities() { return 0; }
|
||||||
|
|
||||||
/** Return the width of the device (in pixels).
|
/** Return the width of the device (in pixels).
|
||||||
*/
|
*/
|
||||||
virtual int width() const;
|
virtual int width() const { return fBitmap.width(); }
|
||||||
/** Return the height of the device (in pixels).
|
/** Return the height of the device (in pixels).
|
||||||
*/
|
*/
|
||||||
virtual int height() const;
|
virtual int height() const { return fBitmap.height(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the bounds of the device in the coordinate space of the root
|
* Return the bounds of the device in the coordinate space of the root
|
||||||
|
@ -154,22 +154,25 @@ protected:
|
||||||
virtual bool filterTextFlags(const SkPaint& paint, TextFlags*);
|
virtual bool filterTextFlags(const SkPaint& paint, TextFlags*);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Let the device know that its matrix has changed; it can query the
|
* Called with the correct matrix and clip before this device is drawn
|
||||||
* matrix when it needs it.
|
* to using those settings. If your subclass overrides this, be sure to
|
||||||
*/
|
* call through to the base class as well.
|
||||||
virtual void markMatrixDirty();
|
*
|
||||||
|
* The clipstack is another view of the clip. It records the actual
|
||||||
/**
|
* geometry that went into building the region. It is present for devices
|
||||||
* Let the device know that its clip has changed; it can query the
|
* that want to parse it, but is not required: the region is a complete
|
||||||
* clip (region or stack) when or if it needs it.
|
* picture of the current clip. (i.e. if you regionize all of the geometry
|
||||||
*/
|
* in the clipstack, you will arrive at an equivalent region to the one
|
||||||
virtual void markClipDirty();
|
* passed in).
|
||||||
|
*/
|
||||||
|
virtual void setMatrixClip(const SkMatrix&, const SkRegion&,
|
||||||
|
const SkClipStack&);
|
||||||
|
|
||||||
/** Called when this device gains focus (i.e becomes the current device
|
/** Called when this device gains focus (i.e becomes the current device
|
||||||
for drawing).
|
for drawing).
|
||||||
*/
|
*/
|
||||||
virtual void gainFocus(SkCanvas*, const SkMatrix&, const SkRegion&,
|
virtual void gainFocus(SkCanvas*, const SkMatrix&, const SkRegion&,
|
||||||
const SkClipStack&);
|
const SkClipStack&) {}
|
||||||
|
|
||||||
/** Clears the entire device to the specified color (including alpha).
|
/** Clears the entire device to the specified color (including alpha).
|
||||||
* Ignores the clip.
|
* Ignores the clip.
|
||||||
|
@ -287,7 +290,7 @@ private:
|
||||||
|
|
||||||
/** Causes any deferred drawing to the device to be completed.
|
/** Causes any deferred drawing to the device to be completed.
|
||||||
*/
|
*/
|
||||||
virtual void flush();
|
virtual void flush() {}
|
||||||
|
|
||||||
SkBitmap fBitmap;
|
SkBitmap fBitmap;
|
||||||
SkIPoint fOrigin;
|
SkIPoint fOrigin;
|
||||||
|
|
|
@ -71,8 +71,8 @@ public:
|
||||||
virtual bool readPixels(const SkIRect& srcRect, SkBitmap* bitmap);
|
virtual bool readPixels(const SkIRect& srcRect, SkBitmap* bitmap);
|
||||||
virtual void writePixels(const SkBitmap& bitmap, int x, int y);
|
virtual void writePixels(const SkBitmap& bitmap, int x, int y);
|
||||||
|
|
||||||
virtual void markMatrixDirty();
|
virtual void setMatrixClip(const SkMatrix& matrix, const SkRegion& clip,
|
||||||
virtual void markClipDirty();
|
const SkClipStack&);
|
||||||
|
|
||||||
virtual void drawPaint(const SkDraw&, const SkPaint& paint);
|
virtual void drawPaint(const SkDraw&, const SkPaint& paint);
|
||||||
virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, size_t count,
|
virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, size_t count,
|
||||||
|
|
|
@ -163,6 +163,8 @@ public:
|
||||||
|
|
||||||
// TODO(vandebo): Remove this as soon as Chrome's Platform device goes away.
|
// TODO(vandebo): Remove this as soon as Chrome's Platform device goes away.
|
||||||
void setOrigin(int x, int y);
|
void setOrigin(int x, int y);
|
||||||
|
virtual void setMatrixClip(const SkMatrix& m, const SkRegion& r,
|
||||||
|
const SkClipStack& c);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef SkDevice INHERITED;
|
typedef SkDevice INHERITED;
|
||||||
|
|
|
@ -118,9 +118,7 @@ struct DeviceCM {
|
||||||
SkRegion::kDifference_Op);
|
SkRegion::kDifference_Op);
|
||||||
}
|
}
|
||||||
|
|
||||||
//fDevice->setMatrixClip(*fMatrix, fClip, clipStack);
|
fDevice->setMatrixClip(*fMatrix, fClip, clipStack);
|
||||||
fDevice->markMatrixDirty();
|
|
||||||
fDevice->markClipDirty();
|
|
||||||
|
|
||||||
#ifdef SK_DEBUG
|
#ifdef SK_DEBUG
|
||||||
if (!fClip.isEmpty()) {
|
if (!fClip.isEmpty()) {
|
||||||
|
@ -214,19 +212,14 @@ private:
|
||||||
|
|
||||||
class SkDrawIter : public SkDraw {
|
class SkDrawIter : public SkDraw {
|
||||||
public:
|
public:
|
||||||
SkDrawIter(SkCanvas* canvas, bool skipEmptyClips = true)
|
SkDrawIter(SkCanvas* canvas, bool skipEmptyClips = true) {
|
||||||
: fCanvas(canvas)
|
fCanvas = canvas;
|
||||||
, fCurrLayer(NULL)
|
|
||||||
, fSkipEmptyClips(skipEmptyClips) {
|
|
||||||
|
|
||||||
if (!canvas) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
canvas->updateDeviceCMCache();
|
canvas->updateDeviceCMCache();
|
||||||
|
|
||||||
fClipStack = &canvas->getTotalClipStack();
|
fClipStack = &canvas->getTotalClipStack();
|
||||||
fBounder = canvas->getBounder();
|
fBounder = canvas->getBounder();
|
||||||
fCurrLayer = canvas->fMCRec->fTopLayer;
|
fCurrLayer = canvas->fMCRec->fTopLayer;
|
||||||
|
fSkipEmptyClips = skipEmptyClips;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool next() {
|
bool next() {
|
||||||
|
|
|
@ -63,18 +63,6 @@ SkMetaData& SkDevice::getMetaData() {
|
||||||
return *fMetaData;
|
return *fMetaData;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t SkDevice::getDeviceCapabilities() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int SkDevice::width() const {
|
|
||||||
return fBitmap.width();
|
|
||||||
}
|
|
||||||
|
|
||||||
int SkDevice::height() const {
|
|
||||||
return fBitmap.height();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SkDevice::lockPixels() {
|
void SkDevice::lockPixels() {
|
||||||
if (fBitmap.lockPixelsAreWritable()) {
|
if (fBitmap.lockPixelsAreWritable()) {
|
||||||
fBitmap.lockPixels();
|
fBitmap.lockPixels();
|
||||||
|
@ -106,8 +94,10 @@ void SkDevice::clear(SkColor color) {
|
||||||
fBitmap.eraseColor(color);
|
fBitmap.eraseColor(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkDevice::onAccessBitmap(SkBitmap* bitmap) {
|
void SkDevice::onAccessBitmap(SkBitmap* bitmap) {}
|
||||||
|
|
||||||
|
void SkDevice::setMatrixClip(const SkMatrix& matrix, const SkRegion& region,
|
||||||
|
const SkClipStack& clipStack) {
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -252,20 +242,3 @@ bool SkDevice::filterTextFlags(const SkPaint& paint, TextFlags* flags) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkDevice::markMatrixDirty() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SkDevice::markClipDirty() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SkDevice::gainFocus(SkCanvas*, const SkMatrix&, const SkRegion&,
|
|
||||||
const SkClipStack&) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void SkDevice::flush() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -338,13 +338,10 @@ void SkGpuDevice::prepareRenderTarget(const SkDraw& draw) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkGpuDevice::markMatrixDirty() {
|
void SkGpuDevice::setMatrixClip(const SkMatrix& matrix, const SkRegion& clip,
|
||||||
INHERITED::markMatrixDirty();
|
const SkClipStack& clipStack) {
|
||||||
fNeedPrepareRenderTarget = true;
|
this->INHERITED::setMatrixClip(matrix, clip, clipStack);
|
||||||
}
|
// We don't need to set them now because the context may not reflect this device.
|
||||||
|
|
||||||
void SkGpuDevice::markClipDirty() {
|
|
||||||
INHERITED::markClipDirty();
|
|
||||||
fNeedPrepareRenderTarget = true;
|
fNeedPrepareRenderTarget = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1135,6 +1135,11 @@ void SkPDFDevice::setOrigin(int x, int y) {
|
||||||
INHERITED::setOrigin(x, y);
|
INHERITED::setOrigin(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SkPDFDevice::setMatrixClip(const SkMatrix& m, const SkRegion& r,
|
||||||
|
const SkClipStack& c) {
|
||||||
|
INHERITED::setMatrixClip(m, r, c);
|
||||||
|
}
|
||||||
|
|
||||||
void SkPDFDevice::createFormXObjectFromDevice(
|
void SkPDFDevice::createFormXObjectFromDevice(
|
||||||
SkRefPtr<SkPDFFormXObject>* xobject) {
|
SkRefPtr<SkPDFFormXObject>* xobject) {
|
||||||
*xobject = new SkPDFFormXObject(this);
|
*xobject = new SkPDFFormXObject(this);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче