Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: Source/platform/graphics/StaticBitmapImage.cpp

Issue 669123002: Fixed Shadow blur for transparent objects (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added missing virtual layout test to TestExpectations Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "platform/graphics/StaticBitmapImage.h" 6 #include "platform/graphics/StaticBitmapImage.h"
7 7
8 #include "platform/graphics/GraphicsContext.h" 8 #include "platform/graphics/GraphicsContext.h"
9 #include "platform/graphics/ImageObserver.h" 9 #include "platform/graphics/ImageObserver.h"
10 #include "platform/graphics/skia/NativeImageSkia.h" 10 #include "platform/graphics/skia/NativeImageSkia.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 FloatRect normSrcRect = adjustForNegativeSize(srcRect); 42 FloatRect normSrcRect = adjustForNegativeSize(srcRect);
43 43
44 normSrcRect.intersect(FloatRect(0, 0, m_image->width(), m_image->height())); 44 normSrcRect.intersect(FloatRect(0, 0, m_image->width(), m_image->height()));
45 45
46 if (normSrcRect.isEmpty() || normDstRect.isEmpty()) 46 if (normSrcRect.isEmpty() || normDstRect.isEmpty())
47 return; // Nothing to draw. 47 return; // Nothing to draw.
48 48
49 ASSERT(normSrcRect.width() <= m_image->width() && normSrcRect.height() <= m_ image->height()); 49 ASSERT(normSrcRect.width() <= m_image->width() && normSrcRect.height() <= m_ image->height());
50 50
51 SkPaint paint; 51 SkPaint paint;
52 ctx->preparePaintForDrawRectToRect(&paint, srcRect, dstRect, compositeOp, bl endMode); 52 ctx->preparePaintForDrawRectToRect(&paint, srcRect, dstRect, compositeOp, bl endMode, !currentFrameKnownToBeOpaque());
53 53
54 SkRect srcSkRect = WebCoreFloatRectToSKRect(normSrcRect); 54 SkRect srcSkRect = WebCoreFloatRectToSKRect(normSrcRect);
55 SkRect dstSkRect = WebCoreFloatRectToSKRect(normDstRect); 55 SkRect dstSkRect = WebCoreFloatRectToSKRect(normDstRect);
56 56
57 SkCanvas* canvas = ctx->canvas(); 57 SkCanvas* canvas = ctx->canvas();
58 58
59 canvas->drawImageRect(m_image.get(), &srcSkRect, dstSkRect, &paint); 59 canvas->drawImageRect(m_image.get(), &srcSkRect, dstSkRect, &paint);
60 60
61 if (ImageObserver* observer = imageObserver()) 61 if (ImageObserver* observer = imageObserver())
62 observer->didDraw(this); 62 observer->didDraw(this);
63 } 63 }
64 64
65 } 65 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698