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

Unified Diff: src/gpu/GrRecordReplaceDraw.cpp

Issue 608823002: Update RecordReplaceDrawTest to generate and pass pictures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reordered #include files 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrRecordReplaceDraw.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrRecordReplaceDraw.cpp
diff --git a/src/gpu/GrRecordReplaceDraw.cpp b/src/gpu/GrRecordReplaceDraw.cpp
index b0e00b8a7494b3eaa2e2c9a09cde3ec5ae49de2a..acdc63fb849c519f6c12995a02b8f83c0fee5342 100644
--- a/src/gpu/GrRecordReplaceDraw.cpp
+++ b/src/gpu/GrRecordReplaceDraw.cpp
@@ -66,19 +66,23 @@ static inline void draw_replacement_bitmap(const GrReplacements::ReplacementInfo
canvas->restore();
}
-void GrRecordReplaceDraw(const SkRecord& record,
+void GrRecordReplaceDraw(const SkPicture* picture,
SkCanvas* canvas,
- const SkBBoxHierarchy* bbh,
const GrReplacements* replacements,
+ const SkMatrix& initialMatrix,
SkDrawPictureCallback* callback) {
SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/);
+ const SkBBoxHierarchy* bbh = picture->fBBH.get();
+ const SkRecord* record = picture->fRecord.get();
+ if (NULL == record) {
+ return;
+ }
+
SkRecords::Draw draw(canvas);
const GrReplacements::ReplacementInfo* ri = NULL;
int searchStart = 0;
- const SkMatrix initialMatrix = canvas->getTotalMatrix();
-
if (bbh) {
// Draw only ops that affect pixels in the canvas's current clip.
// The SkRecord and BBH were recorded in identity space. This canvas
@@ -106,10 +110,10 @@ void GrRecordReplaceDraw(const SkRecord& record,
continue;
}
- record.visit<void>((uintptr_t)ops[i], draw);
+ record->visit<void>((uintptr_t)ops[i], draw);
}
} else {
- for (unsigned int i = 0; i < record.count(); ++i) {
+ for (unsigned int i = 0; i < record->count(); ++i) {
if (callback && callback->abortDrawing()) {
return;
}
@@ -120,7 +124,7 @@ void GrRecordReplaceDraw(const SkRecord& record,
continue;
}
- record.visit<void>(i, draw);
+ record->visit<void>(i, draw);
}
}
}
« no previous file with comments | « src/gpu/GrRecordReplaceDraw.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698