OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "../src/image/SkImagePriv.h" | 8 #include "../src/image/SkImagePriv.h" |
9 #include "../src/image/SkSurface_Base.h" | 9 #include "../src/image/SkSurface_Base.h" |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 SkCanvas canvas(bitmap); | 44 SkCanvas canvas(bitmap); |
45 | 45 |
46 SkPaint paint; | 46 SkPaint paint; |
47 paint.setXfermodeMode(SkXfermode::kSrc_Mode); | 47 paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
48 surface->draw(&canvas, -SkIntToScalar(x), -SkIntToScalar(y), &paint); | 48 surface->draw(&canvas, -SkIntToScalar(x), -SkIntToScalar(y), &paint); |
49 return pixel; | 49 return pixel; |
50 } | 50 } |
51 | 51 |
52 class MockSurface : public SkSurface_Base { | 52 class MockSurface : public SkSurface_Base { |
53 public: | 53 public: |
54 MockSurface(int width, int height) : SkSurface_Base(width, height) { | 54 MockSurface(int width, int height) : SkSurface_Base(width, height, NULL) { |
55 clearCounts(); | 55 clearCounts(); |
56 fBitmap.allocN32Pixels(width, height); | 56 fBitmap.allocN32Pixels(width, height); |
57 } | 57 } |
58 | 58 |
59 virtual SkCanvas* onNewCanvas() SK_OVERRIDE { | 59 virtual SkCanvas* onNewCanvas() SK_OVERRIDE { |
60 return SkNEW_ARGS(SkCanvas, (fBitmap)); | 60 return SkNEW_ARGS(SkCanvas, (fBitmap)); |
61 } | 61 } |
62 | 62 |
63 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE { | 63 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE { |
64 return NULL; | 64 return NULL; |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 TestDeferredCanvasSurface(reporter, NULL); | 907 TestDeferredCanvasSurface(reporter, NULL); |
908 TestDeferredCanvasSetSurface(reporter, NULL); | 908 TestDeferredCanvasSetSurface(reporter, NULL); |
909 } | 909 } |
910 | 910 |
911 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) { | 911 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) { |
912 if (factory != NULL) { | 912 if (factory != NULL) { |
913 TestDeferredCanvasSurface(reporter, factory); | 913 TestDeferredCanvasSurface(reporter, factory); |
914 TestDeferredCanvasSetSurface(reporter, factory); | 914 TestDeferredCanvasSetSurface(reporter, factory); |
915 } | 915 } |
916 } | 916 } |
OLD | NEW |