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

Side by Side Diff: tests/DeferredCanvasTest.cpp

Issue 551463004: introduce Props to surface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: un-plumb props into device (not needed) Created 6 years, 3 months 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 /* 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
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, SkSurface Props()) {
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 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 TestDeferredCanvasSurface(reporter, NULL); 853 TestDeferredCanvasSurface(reporter, NULL);
854 TestDeferredCanvasSetSurface(reporter, NULL); 854 TestDeferredCanvasSetSurface(reporter, NULL);
855 } 855 }
856 856
857 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) { 857 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) {
858 if (factory != NULL) { 858 if (factory != NULL) {
859 TestDeferredCanvasSurface(reporter, factory); 859 TestDeferredCanvasSurface(reporter, factory);
860 TestDeferredCanvasSetSurface(reporter, factory); 860 TestDeferredCanvasSetSurface(reporter, factory);
861 } 861 }
862 } 862 }
OLDNEW
« src/image/SkSurface_Raster.cpp ('K') | « src/image/SkSurface_Raster.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698