lockPixelsAreWritable is deprecated

BUG=skia:4328
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2177063002

TBR=

Review-Url: https://codereview.chromium.org/2177063002
This commit is contained in:
reed 2016-07-24 12:30:34 -07:00 committed by Commit bot
parent 057ae8a15d
commit b560b5c8c0
3 changed files with 4 additions and 8 deletions

View File

@ -455,6 +455,7 @@ public:
* not be used as targets for a raster device/canvas (since all pixels
* modifications will be lost when unlockPixels() is called.)
*/
// DEPRECATED
bool lockPixelsAreWritable() const;
bool requestLock(SkAutoPixmapUnlock* result) const;

View File

@ -142,7 +142,7 @@ const SkBitmap& SkBitmapDevice::onAccessBitmap() {
}
bool SkBitmapDevice::onAccessPixels(SkPixmap* pmap) {
if (fBitmap.lockPixelsAreWritable() && this->onPeekPixels(pmap)) {
if (this->onPeekPixels(pmap)) {
fBitmap.notifyPixelsChanged();
return true;
}
@ -185,16 +185,12 @@ bool SkBitmapDevice::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, s
void SkBitmapDevice::onAttachToCanvas(SkCanvas* canvas) {
INHERITED::onAttachToCanvas(canvas);
if (fBitmap.lockPixelsAreWritable()) {
fBitmap.lockPixels();
}
fBitmap.lockPixels();
}
void SkBitmapDevice::onDetachFromCanvas() {
INHERITED::onDetachFromCanvas();
if (fBitmap.lockPixelsAreWritable()) {
fBitmap.unlockPixels();
}
fBitmap.unlockPixels();
}
///////////////////////////////////////////////////////////////////////////////

View File

@ -130,7 +130,6 @@ static void fill_src_texture(GrTexture* texture) {
#endif
static void fill_dst_bmp_with_init_data(SkBitmap* bitmap) {
SkASSERT(bitmap->lockPixelsAreWritable());
SkAutoLockPixels alp(*bitmap);
int w = bitmap->width();
int h = bitmap->height();