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

Side by Side Diff: tests/DeferredCanvasTest.cpp

Issue 1204433002: Begin kLegacyFontHost_InitType cleanup (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add dox Created 5 years, 6 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
« no previous file with comments | « src/utils/SkDeferredCanvas.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "SkBitmapDevice.h"
12 #include "SkBitmapProcShader.h" 11 #include "SkBitmapProcShader.h"
13 #include "SkDeferredCanvas.h" 12 #include "SkDeferredCanvas.h"
14 #include "SkGradientShader.h" 13 #include "SkGradientShader.h"
15 #include "SkShader.h" 14 #include "SkShader.h"
16 #include "SkSurface.h" 15 #include "SkSurface.h"
17 #include "Test.h" 16 #include "Test.h"
18 #include "sk_tool_utils.h" 17 #include "sk_tool_utils.h"
19 18
20 #if SK_SUPPORT_GPU 19 #if SK_SUPPORT_GPU
21 #include "GrContextFactory.h" 20 #include "GrContextFactory.h"
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 { 432 {
434 SkPaint paint; 433 SkPaint paint;
435 paint.setStyle(SkPaint::kFill_Style); 434 paint.setStyle(SkPaint::kFill_Style);
436 paint.setAlpha(100); 435 paint.setAlpha(100);
437 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 436 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
438 canvas->drawRect(fullRect, paint); 437 canvas->drawRect(fullRect, paint);
439 REPORTER_ASSERT(reporter, canvas->isFreshFrame()); 438 REPORTER_ASSERT(reporter, canvas->isFreshFrame());
440 } 439 }
441 } 440 }
442 441
443 class MockDevice : public SkBitmapDevice {
444 public:
445 MockDevice(const SkBitmap& bm) : SkBitmapDevice(bm) {
446 fDrawBitmapCallCount = 0;
447 }
448 virtual void drawBitmap(const SkDraw&, const SkBitmap&,
449 const SkMatrix&, const SkPaint&) override {
450 fDrawBitmapCallCount++;
451 }
452
453 int fDrawBitmapCallCount;
454 };
455
456 class NotificationCounter : public SkDeferredCanvas::NotificationClient { 442 class NotificationCounter : public SkDeferredCanvas::NotificationClient {
457 public: 443 public:
458 NotificationCounter() { 444 NotificationCounter() {
459 fPrepareForDrawCount = fStorageAllocatedChangedCount = 445 fPrepareForDrawCount = fStorageAllocatedChangedCount =
460 fFlushedDrawCommandsCount = fSkippedPendingDrawCommandsCount = 0; 446 fFlushedDrawCommandsCount = fSkippedPendingDrawCommandsCount = 0;
461 } 447 }
462 448
463 void prepareForDraw() override { 449 void prepareForDraw() override {
464 fPrepareForDrawCount++; 450 fPrepareForDrawCount++;
465 } 451 }
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 TestDeferredCanvasSurface(reporter, NULL); 939 TestDeferredCanvasSurface(reporter, NULL);
954 TestDeferredCanvasSetSurface(reporter, NULL); 940 TestDeferredCanvasSetSurface(reporter, NULL);
955 } 941 }
956 942
957 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) { 943 DEF_GPUTEST(DeferredCanvas_GPU, reporter, factory) {
958 if (factory != NULL) { 944 if (factory != NULL) {
959 TestDeferredCanvasSurface(reporter, factory); 945 TestDeferredCanvasSurface(reporter, factory);
960 TestDeferredCanvasSetSurface(reporter, factory); 946 TestDeferredCanvasSetSurface(reporter, factory);
961 } 947 }
962 } 948 }
OLDNEW
« no previous file with comments | « src/utils/SkDeferredCanvas.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698