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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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*, | 246 const SkIRect*, |
247 const SkMatrix&, const SkPaint&) { | 247 const SkMatrix&, const SkPaint&) SK_OVERRIDE { |
248 fDrawBitmapCallCount++; | 248 fDrawBitmapCallCount++; |
249 } | 249 } |
250 | 250 |
251 int fDrawBitmapCallCount; | 251 int fDrawBitmapCallCount; |
252 }; | 252 }; |
253 | 253 |
254 // Verifies that the deferred canvas triggers a flush when its memory | 254 // Verifies that the deferred canvas triggers a flush when its memory |
255 // limit is exceeded | 255 // limit is exceeded |
256 static void TestDeferredCanvasMemoryLimit(skiatest::Reporter* reporter) { | 256 static void TestDeferredCanvasMemoryLimit(skiatest::Reporter* reporter) { |
257 SkBitmap store; | 257 SkBitmap store; |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 TestDeferredCanvasSurface(reporter, NULL); | 693 TestDeferredCanvasSurface(reporter, NULL); |
694 TestDeferredCanvasSetSurface(reporter, NULL); | 694 TestDeferredCanvasSetSurface(reporter, NULL); |
695 if (NULL != factory) { | 695 if (NULL != factory) { |
696 TestDeferredCanvasSurface(reporter, factory); | 696 TestDeferredCanvasSurface(reporter, factory); |
697 TestDeferredCanvasSetSurface(reporter, factory); | 697 TestDeferredCanvasSetSurface(reporter, factory); |
698 } | 698 } |
699 } | 699 } |
700 | 700 |
701 #include "TestClassDef.h" | 701 #include "TestClassDef.h" |
702 DEFINE_GPUTESTCLASS("DeferredCanvas", TestDeferredCanvasClass, TestDeferredCanva
s) | 702 DEFINE_GPUTESTCLASS("DeferredCanvas", TestDeferredCanvasClass, TestDeferredCanva
s) |
OLD | NEW |