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

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

Issue 783493002: 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,
65 unsigned start, unsigned stop, 64 unsigned start, unsigned stop,
66 const SkMatrix& initialCTM) { 65 const SkMatrix& initialCTM) {
67 SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/); 66 SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/);
68 67
69 stop = SkTMin(stop, record.count()); 68 stop = SkTMin(stop, record.count());
70 SkRecords::PartialDraw draw(canvas, NULL, 0, clearRect, initialCTM); 69 SkRecords::Draw draw(canvas, drawablePicts, NULL, drawableCount, &initialCTM );
71 for (unsigned i = start; i < stop; i++) { 70 for (unsigned i = start; i < stop; i++) {
72 record.visit<void>(i, draw); 71 record.visit<void>(i, draw);
73 } 72 }
74 } 73 }
75 74
76 namespace SkRecords { 75 namespace SkRecords {
77 76
78 // FIXME: SkBitmaps are stateful, so we need to copy them to play back in multip le threads. 77 // FIXME: SkBitmaps are stateful, so we need to copy them to play back in multip le threads.
79 static SkBitmap shallow_copy(const SkBitmap& bitmap) { 78 static SkBitmap shallow_copy(const SkBitmap& bitmap) {
80 return bitmap; 79 return bitmap;
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 SkRecords::CollectLayers visitor(cullRect, record, pictList, data); 801 SkRecords::CollectLayers visitor(cullRect, record, pictList, data);
803 802
804 for (unsigned curOp = 0; curOp < record.count(); curOp++) { 803 for (unsigned curOp = 0; curOp < record.count(); curOp++) {
805 visitor.setCurrentOp(curOp); 804 visitor.setCurrentOp(curOp);
806 record.visit<void>(curOp, visitor); 805 record.visit<void>(curOp, visitor);
807 } 806 }
808 807
809 visitor.cleanUp(bbh); 808 visitor.cleanUp(bbh);
810 } 809 }
811 810
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