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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/PlaceholderImage.cpp

Issue 2447623002: Remove ImageObserver::didDraw() (Closed)
Patch Set: Rebawse Created 4 years 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "platform/graphics/PlaceholderImage.h" 5 #include "platform/graphics/PlaceholderImage.h"
6 6
7 #include "platform/geometry/FloatRect.h" 7 #include "platform/geometry/FloatRect.h"
8 #include "platform/graphics/Color.h" 8 #include "platform/graphics/Color.h"
9 #include "platform/graphics/GraphicsContext.h" 9 #include "platform/graphics/GraphicsContext.h"
10 #include "platform/graphics/ImageObserver.h" 10 #include "platform/graphics/ImageObserver.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 if (!srcRect.intersects(FloatRect(0.0f, 0.0f, 56 if (!srcRect.intersects(FloatRect(0.0f, 0.0f,
57 static_cast<float>(m_size.width()), 57 static_cast<float>(m_size.width()),
58 static_cast<float>(m_size.height())))) { 58 static_cast<float>(m_size.height())))) {
59 return; 59 return;
60 } 60 }
61 61
62 SkPaint paint(basePaint); 62 SkPaint paint(basePaint);
63 paint.setStyle(SkPaint::kFill_Style); 63 paint.setStyle(SkPaint::kFill_Style);
64 paint.setColor(kFillColor); 64 paint.setColor(kFillColor);
65 canvas->drawRect(destRect, paint); 65 canvas->drawRect(destRect, paint);
66
67 if (getImageObserver())
68 getImageObserver()->didDraw(this);
69 }
70
71 void PlaceholderImage::drawPattern(GraphicsContext& destContext,
72 const FloatRect& srcRect,
73 const FloatSize& scale,
74 const FloatPoint& phase,
75 SkBlendMode compositeOp,
76 const FloatRect& destRect,
77 const FloatSize& repeatSpacing) {
78 Image::drawPattern(destContext, srcRect, scale, phase, compositeOp, destRect,
79 repeatSpacing);
80
81 if (getImageObserver())
82 getImageObserver()->didDraw(this);
83 } 66 }
84 67
85 void PlaceholderImage::destroyDecodedData() { 68 void PlaceholderImage::destroyDecodedData() {
86 m_imageForCurrentFrame.reset(); 69 m_imageForCurrentFrame.reset();
87 } 70 }
88 71
89 } // namespace blink 72 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698