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

Side by Side Diff: src/core/SkRecordDraw.cpp

Issue 778563002: Revert "Change clear() to respect the clip" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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/core/SkRecordDraw.h ('k') | src/core/SkRecorder.h » ('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 2014 Google Inc. 2 * Copyright 2014 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 "SkLayerInfo.h" 8 #include "SkLayerInfo.h"
9 #include "SkRecordDraw.h" 9 #include "SkRecordDraw.h"
10 #include "SkPatchUtils.h" 10 #include "SkPatchUtils.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // This visit call uses the SkRecords::Draw::operator() to call 54 // This visit call uses the SkRecords::Draw::operator() to call
55 // methods on the |canvas|, wrapped by methods defined with the 55 // methods on the |canvas|, wrapped by methods defined with the
56 // DRAW() macro. 56 // DRAW() macro.
57 record.visit<void>(i, draw); 57 record.visit<void>(i, draw);
58 } 58 }
59 } 59 }
60 } 60 }
61 61
62 void SkRecordPartialDraw(const SkRecord& record, SkCanvas* canvas, 62 void SkRecordPartialDraw(const SkRecord& record, SkCanvas* canvas,
63 SkPicture const* const drawablePicts[], int drawableCou nt, 63 SkPicture const* const drawablePicts[], int drawableCou nt,
64 const SkRect& clearRect,
64 unsigned start, unsigned stop, 65 unsigned start, unsigned stop,
65 const SkMatrix& initialCTM) { 66 const SkMatrix& initialCTM) {
66 SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/); 67 SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/);
67 68
68 stop = SkTMin(stop, record.count()); 69 stop = SkTMin(stop, record.count());
69 SkRecords::Draw draw(canvas, drawablePicts, NULL, drawableCount, &initialCTM ); 70 SkRecords::PartialDraw draw(canvas, NULL, 0, clearRect, initialCTM);
70 for (unsigned i = start; i < stop; i++) { 71 for (unsigned i = start; i < stop; i++) {
71 record.visit<void>(i, draw); 72 record.visit<void>(i, draw);
72 } 73 }
73 } 74 }
74 75
75 namespace SkRecords { 76 namespace SkRecords {
76 77
77 // FIXME: SkBitmaps are stateful, so we need to copy them to play back in multip le threads. 78 // FIXME: SkBitmaps are stateful, so we need to copy them to play back in multip le threads.
78 static SkBitmap shallow_copy(const SkBitmap& bitmap) { 79 static SkBitmap shallow_copy(const SkBitmap& bitmap) {
79 return bitmap; 80 return bitmap;
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 SkRecords::CollectLayers visitor(cullRect, record, pictList, data); 802 SkRecords::CollectLayers visitor(cullRect, record, pictList, data);
802 803
803 for (unsigned curOp = 0; curOp < record.count(); curOp++) { 804 for (unsigned curOp = 0; curOp < record.count(); curOp++) {
804 visitor.setCurrentOp(curOp); 805 visitor.setCurrentOp(curOp);
805 record.visit<void>(curOp, visitor); 806 record.visit<void>(curOp, visitor);
806 } 807 }
807 808
808 visitor.cleanUp(bbh); 809 visitor.cleanUp(bbh);
809 } 810 }
810 811
OLDNEW
« no previous file with comments | « src/core/SkRecordDraw.h ('k') | src/core/SkRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698