aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapDevice.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-05-06 13:44:30 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-06 15:17:58 +0000
commit95e2b91d76d60ae69588ca700211146aabddbe5a (patch)
tree2ea8b137a61d7bb8bc2a3329929be38d68d25696 /src/core/SkBitmapDevice.cpp
parent963d1ef8acad6861e1408bd60395a644f066c5be (diff)
Revert "Respect SkBitmapDeviceFilteredSurfaceProps in SkThreadedBMPDevice"
This reverts commit b9a1e688fd9c3e64c50d9159481e72a812f978c1. Reason for revert: breaking msan Original change's description: > Respect SkBitmapDeviceFilteredSurfaceProps in SkThreadedBMPDevice > > Bug: skia:7909 > Change-Id: I3e480a57f16eec97706296137c8c1061555b9701 > Reviewed-on: https://skia-review.googlesource.com/126100 > Commit-Queue: Ben Wagner <bungeman@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> > Reviewed-by: Ben Wagner <bungeman@google.com> > Auto-Submit: Yuqian Li <liyuqian@google.com> TBR=mtklein@google.com,bungeman@google.com,liyuqian@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia:7909 Change-Id: Iee605220721a8b9f74b652106d22b4516a87900a Reviewed-on: https://skia-review.googlesource.com/126320 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/core/SkBitmapDevice.cpp')
-rw-r--r--src/core/SkBitmapDevice.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index 522f016a2d..b49818c2a1 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -567,6 +567,25 @@ void SkBitmapDevice::drawSprite(const SkBitmap& bitmap, int x, int y, const SkPa
BDDraw(this).drawSprite(bitmap, x, y, paint);
}
+class SkBitmapDeviceFilteredSurfaceProps {
+public:
+ SkBitmapDeviceFilteredSurfaceProps(const SkBitmap& bitmap, const SkPaint& paint,
+ const SkSurfaceProps& surfaceProps) {
+ if (kN32_SkColorType != bitmap.colorType() || !paint.isSrcOver()) {
+ SkSurfaceProps* newPaint = fLazy.init(surfaceProps.flags(), kUnknown_SkPixelGeometry);
+ fSurfaceProps = newPaint;
+ } else {
+ fSurfaceProps = &surfaceProps;
+ }
+ }
+
+ const SkSurfaceProps& operator()() const { return *fSurfaceProps; }
+
+private:
+ const SkSurfaceProps* fSurfaceProps;
+ SkTLazy<SkSurfaceProps> fLazy;
+};
+
void SkBitmapDevice::drawText(const void* text, size_t len,
SkScalar x, SkScalar y, const SkPaint& paint) {
SkBitmapDeviceFilteredSurfaceProps props(fBitmap, paint, fSurfaceProps);