Commit ff7e85cb authored by reed's avatar reed Committed by Commit bot

Subclasses of SkDevice that overrode onAccessBitmap can remove that code -- it is not being called.

One caller on platform_skia was calling it (incidentally), but they can call accessPixels() instead for the same result.

BUG=647756

Review-Url: https://codereview.chromium.org/2340813006
Cr-Commit-Position: refs/heads/master@{#419446}
parent a94e0ecd
......@@ -205,10 +205,6 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal,
# define SK_SUPPORT_LEGACY_PICTUREINSTALLPIXELREF
#endif
#ifndef SK_SUPPORT_LEGACY_ACCESSBITMAP
# define SK_SUPPORT_LEGACY_ACCESSBITMAP
#endif
// Workaround for poor anisotropic mipmap quality,
// pending Skia ripmap support.
// (https://bugs.chromium.org/p/skia/issues/detail?id=4863)
......
......@@ -51,10 +51,10 @@ SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const CreateInfo& info,
PlatformSurface BitmapPlatformDevice::BeginPlatformPaint(const SkMatrix& transform,
const SkIRect& clip_bounds) {
// TODO(tomhudson): propagate transform and clip
// TODO(zhenghao): What should we return? The ptr to the address of the
// pixels? Maybe this won't be called at all.
return accessBitmap(true).getPixels();
SkPixmap pixmap;
return accessPixels(&pixmap) ? pixmap.writable_addr() : nullptr;
}
// PlatformCanvas impl
......
......@@ -197,14 +197,6 @@ HDC BitmapPlatformDevice::BeginPlatformPaint(const SkMatrix& transform,
return GetBitmapDC(transform, clip_bounds);
}
const SkBitmap& BitmapPlatformDevice::onAccessBitmap() {
// FIXME(brettw) OPTIMIZATION: We should only flush if we know a GDI
// operation has occurred on our DC.
if (IsBitmapDCCreated())
GdiFlush();
return SkBitmapDevice::onAccessBitmap();
}
SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const CreateInfo& cinfo,
const SkPaint*) {
const SkImageInfo& info = cinfo.fInfo;
......
......@@ -41,11 +41,6 @@ class SK_API BitmapPlatformDevice : public SkBitmapDevice,
~BitmapPlatformDevice() override;
protected:
// Flushes the Windows device context so that the pixel data can be accessed
// directly by Skia. Overridden from SkBaseDevice, this is called when Skia
// starts accessing pixel data.
const SkBitmap& onAccessBitmap() override;
SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override;
private:
......
......@@ -102,9 +102,10 @@ bool VerifyRoundedRect(const SkCanvas& canvas,
int y,
int w,
int h) {
SkBaseDevice* device = canvas.getTopDevice(true);
const SkBitmap& bitmap = device->accessBitmap(false);
SkAutoLockPixels lock(bitmap);
SkPixmap pixmap;
ASSERT_TRUE(canvas.peekPixels(&pixmap));
SkBitmap bitmap;
bitmap.installPixels(pixmap);
// Check corner points first. They should be of canvas_color.
if (!IsOfColor(bitmap, x, y, canvas_color)) return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment