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

Side by Side Diff: third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp

Issue 2559013002: Add ColorBehavior to blink::Image draw methods (Closed)
Patch Set: Rebase 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 "core/svg/graphics/SVGImage.h" 5 #include "core/svg/graphics/SVGImage.h"
6 6
7 #include "core/svg/graphics/SVGImageChromeClient.h" 7 #include "core/svg/graphics/SVGImageChromeClient.h"
8 #include "platform/SharedBuffer.h" 8 #include "platform/SharedBuffer.h"
9 #include "platform/Timer.h" 9 #include "platform/Timer.h"
10 #include "platform/geometry/FloatRect.h" 10 #include "platform/geometry/FloatRect.h"
(...skipping 14 matching lines...) Expand all
25 m_image->setData(SharedBuffer::create(data, strlen(data)), true); 25 m_image->setData(SharedBuffer::create(data, strlen(data)), true);
26 } 26 }
27 27
28 void pumpFrame() { 28 void pumpFrame() {
29 Image* image = m_image.get(); 29 Image* image = m_image.get();
30 std::unique_ptr<SkCanvas> nullCanvas = SkMakeNullCanvas(); 30 std::unique_ptr<SkCanvas> nullCanvas = SkMakeNullCanvas();
31 SkPaint paint; 31 SkPaint paint;
32 FloatRect dummyRect(0, 0, 100, 100); 32 FloatRect dummyRect(0, 0, 100, 100);
33 image->draw(nullCanvas.get(), paint, dummyRect, dummyRect, 33 image->draw(nullCanvas.get(), paint, dummyRect, dummyRect,
34 DoNotRespectImageOrientation, 34 DoNotRespectImageOrientation,
35 Image::DoNotClampImageToSourceRect); 35 Image::DoNotClampImageToSourceRect,
36 ColorBehavior::transformToGlobalTarget());
36 } 37 }
37 38
38 private: 39 private:
39 class PauseControlImageObserver 40 class PauseControlImageObserver
40 : public GarbageCollectedFinalized<PauseControlImageObserver>, 41 : public GarbageCollectedFinalized<PauseControlImageObserver>,
41 public ImageObserver { 42 public ImageObserver {
42 USING_GARBAGE_COLLECTED_MIXIN(PauseControlImageObserver); 43 USING_GARBAGE_COLLECTED_MIXIN(PauseControlImageObserver);
43 44
44 public: 45 public:
45 PauseControlImageObserver(bool shouldPause) : m_shouldPause(shouldPause) {} 46 PauseControlImageObserver(bool shouldPause) : m_shouldPause(shouldPause) {}
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 EXPECT_TRUE(chromeClient.isSuspended()); 134 EXPECT_TRUE(chromeClient.isSuspended());
134 EXPECT_FALSE(timer->isActive()); 135 EXPECT_FALSE(timer->isActive());
135 136
136 // Simulate a draw. This should resume the animation again. 137 // Simulate a draw. This should resume the animation again.
137 pumpFrame(); 138 pumpFrame();
138 EXPECT_FALSE(chromeClient.isSuspended()); 139 EXPECT_FALSE(chromeClient.isSuspended());
139 EXPECT_TRUE(timer->isActive()); 140 EXPECT_TRUE(timer->isActive());
140 } 141 }
141 142
142 } // namespace blink 143 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698