OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "platform/graphics/Color.h" | 30 #include "platform/graphics/Color.h" |
31 #include "platform/graphics/GraphicsContext.h" | 31 #include "platform/graphics/GraphicsContext.h" |
32 #include "public/platform/WebFloatRect.h" | 32 #include "public/platform/WebFloatRect.h" |
33 #include "public/platform/WebRect.h" | 33 #include "public/platform/WebRect.h" |
34 #include "skia/ext/platform_canvas.h" | 34 #include "skia/ext/platform_canvas.h" |
35 | 35 |
36 #include <gtest/gtest.h> | 36 #include <gtest/gtest.h> |
37 | 37 |
38 using blink::WebRect; | 38 using blink::WebRect; |
39 using blink::WebFloatRect; | 39 using blink::WebFloatRect; |
40 using namespace WebCore; | 40 using namespace blink; |
41 | 41 |
42 namespace { | 42 namespace { |
43 | 43 |
44 struct PaintCallback { | 44 struct PaintCallback { |
45 virtual void operator()(GraphicsContext&, const IntRect&) = 0; | 45 virtual void operator()(GraphicsContext&, const IntRect&) = 0; |
46 }; | 46 }; |
47 | 47 |
48 class TestLayerPainterChromium : public GraphicsContextPainter { | 48 class TestLayerPainterChromium : public GraphicsContextPainter { |
49 public: | 49 public: |
50 TestLayerPainterChromium(PaintCallback& callback) : m_callback(callback) { } | 50 TestLayerPainterChromium(PaintCallback& callback) : m_callback(callback) { } |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 TestLayerPainterChromium painter(fillPartial); | 188 TestLayerPainterChromium painter(fillPartial); |
189 OpaqueRectTrackingContentLayerDelegate delegate(&painter); | 189 OpaqueRectTrackingContentLayerDelegate delegate(&painter); |
190 | 190 |
191 WebFloatRect opaqueRect; | 191 WebFloatRect opaqueRect; |
192 WebRect contentRect(11, 12, 389, 388); | 192 WebRect contentRect(11, 12, 389, 388); |
193 delegate.paintContents(skCanvas(), contentRect, false, opaqueRect); | 193 delegate.paintContents(skCanvas(), contentRect, false, opaqueRect); |
194 EXPECT_EQ_RECT(WebFloatRect(partialRect.x(), partialRect.y(), partialRect.wi
dth(), partialRect.height()), opaqueRect); | 194 EXPECT_EQ_RECT(WebFloatRect(partialRect.x(), partialRect.y(), partialRect.wi
dth(), partialRect.height()), opaqueRect); |
195 } | 195 } |
196 | 196 |
197 } // namespace | 197 } // namespace |
OLD | NEW |