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

Side by Side Diff: tests/PictureTest.cpp

Issue 1533953002: change signature for virtual related to saveLayer, passing SaveLayerRec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update comment Created 5 years 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/debugger/SkObjectParser.cpp ('k') | no next file » | 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 "SkBBoxHierarchy.h" 8 #include "SkBBoxHierarchy.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 */ 552 */
553 class SaveCountingCanvas : public SkCanvas { 553 class SaveCountingCanvas : public SkCanvas {
554 public: 554 public:
555 SaveCountingCanvas(int width, int height) 555 SaveCountingCanvas(int width, int height)
556 : INHERITED(width, height) 556 : INHERITED(width, height)
557 , fSaveCount(0) 557 , fSaveCount(0)
558 , fSaveLayerCount(0) 558 , fSaveLayerCount(0)
559 , fRestoreCount(0){ 559 , fRestoreCount(0){
560 } 560 }
561 561
562 virtual SaveLayerStrategy willSaveLayer(const SkRect* bounds, const SkPaint* paint, 562 SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec& rec) override {
563 SaveFlags flags) override {
564 ++fSaveLayerCount; 563 ++fSaveLayerCount;
565 return this->INHERITED::willSaveLayer(bounds, paint, flags); 564 return this->INHERITED::getSaveLayerStrategy(rec);
566 } 565 }
567 566
568 void willSave() override { 567 void willSave() override {
569 ++fSaveCount; 568 ++fSaveCount;
570 this->INHERITED::willSave(); 569 this->INHERITED::willSave();
571 } 570 }
572 571
573 void willRestore() override { 572 void willRestore() override {
574 ++fRestoreCount; 573 ++fRestoreCount;
575 this->INHERITED::willRestore(); 574 this->INHERITED::willRestore();
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 1379
1381 SkAutoTDelete<SkStream> rstream(wstream.detachAsStream()); 1380 SkAutoTDelete<SkStream> rstream(wstream.detachAsStream());
1382 SkAutoTUnref<SkPicture> deserializedPicture(SkPicture::CreateFromStream(rstr eam)); 1381 SkAutoTUnref<SkPicture> deserializedPicture(SkPicture::CreateFromStream(rstr eam));
1383 1382
1384 REPORTER_ASSERT(r, SkToBool(deserializedPicture)); 1383 REPORTER_ASSERT(r, SkToBool(deserializedPicture));
1385 REPORTER_ASSERT(r, deserializedPicture->cullRect().left() == 1); 1384 REPORTER_ASSERT(r, deserializedPicture->cullRect().left() == 1);
1386 REPORTER_ASSERT(r, deserializedPicture->cullRect().top() == 2); 1385 REPORTER_ASSERT(r, deserializedPicture->cullRect().top() == 2);
1387 REPORTER_ASSERT(r, deserializedPicture->cullRect().right() == 3); 1386 REPORTER_ASSERT(r, deserializedPicture->cullRect().right() == 3);
1388 REPORTER_ASSERT(r, deserializedPicture->cullRect().bottom() == 4); 1387 REPORTER_ASSERT(r, deserializedPicture->cullRect().bottom() == 4);
1389 } 1388 }
OLDNEW
« no previous file with comments | « src/utils/debugger/SkObjectParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698