OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "Test.h" | 8 #include "Test.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkBitmapProcShader.h" | 10 #include "SkBitmapProcShader.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 REPORTER_ASSERT(reporter, canvas->isFreshFrame()); | 236 REPORTER_ASSERT(reporter, canvas->isFreshFrame()); |
237 } | 237 } |
238 } | 238 } |
239 | 239 |
240 class MockDevice : public SkDevice { | 240 class MockDevice : public SkDevice { |
241 public: | 241 public: |
242 MockDevice(const SkBitmap& bm) : SkDevice(bm) { | 242 MockDevice(const SkBitmap& bm) : SkDevice(bm) { |
243 fDrawBitmapCallCount = 0; | 243 fDrawBitmapCallCount = 0; |
244 } | 244 } |
245 virtual void drawBitmap(const SkDraw&, const SkBitmap&, | 245 virtual void drawBitmap(const SkDraw&, const SkBitmap&, |
246 const SkIRect*, | |
247 const SkMatrix&, const SkPaint&) SK_OVERRIDE { | 246 const SkMatrix&, const SkPaint&) SK_OVERRIDE { |
248 fDrawBitmapCallCount++; | 247 fDrawBitmapCallCount++; |
249 } | 248 } |
250 | 249 |
251 int fDrawBitmapCallCount; | 250 int fDrawBitmapCallCount; |
252 }; | 251 }; |
253 | 252 |
254 // Verifies that the deferred canvas triggers a flush when its memory | 253 // Verifies that the deferred canvas triggers a flush when its memory |
255 // limit is exceeded | 254 // limit is exceeded |
256 static void TestDeferredCanvasMemoryLimit(skiatest::Reporter* reporter) { | 255 static void TestDeferredCanvasMemoryLimit(skiatest::Reporter* reporter) { |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 TestDeferredCanvasSurface(reporter, NULL); | 692 TestDeferredCanvasSurface(reporter, NULL); |
694 TestDeferredCanvasSetSurface(reporter, NULL); | 693 TestDeferredCanvasSetSurface(reporter, NULL); |
695 if (NULL != factory) { | 694 if (NULL != factory) { |
696 TestDeferredCanvasSurface(reporter, factory); | 695 TestDeferredCanvasSurface(reporter, factory); |
697 TestDeferredCanvasSetSurface(reporter, factory); | 696 TestDeferredCanvasSetSurface(reporter, factory); |
698 } | 697 } |
699 } | 698 } |
700 | 699 |
701 #include "TestClassDef.h" | 700 #include "TestClassDef.h" |
702 DEFINE_GPUTESTCLASS("DeferredCanvas", TestDeferredCanvasClass, TestDeferredCanva
s) | 701 DEFINE_GPUTESTCLASS("DeferredCanvas", TestDeferredCanvasClass, TestDeferredCanva
s) |
OLD | NEW |