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

Unified Diff: src/gpu/GrRecordReplaceDraw.cpp

Issue 1130283004: Revert of Sketch splitting SkPicture into an interface and SkBigPicture. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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/GrLayerHoister.cpp ('k') | src/gpu/SkGpuDevice.h » ('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 6f05206dcc69b7cea899bd4a066aa62d86393c67..dacc939e62693cb4d64f4f93b2347a74b090c590 100644
--- a/src/gpu/GrRecordReplaceDraw.cpp
+++ b/src/gpu/GrRecordReplaceDraw.cpp
@@ -8,7 +8,6 @@
#include "GrContext.h"
#include "GrLayerCache.h"
#include "GrRecordReplaceDraw.h"
-#include "SkBigPicture.h"
#include "SkCanvasPriv.h"
#include "SkGrPixelRef.h"
#include "SkImage.h"
@@ -46,7 +45,7 @@
canvas->drawBitmapRectToRect(bm, &src, dst, layer->paint());
canvas->restore();
} else {
- canvas->drawSprite(bm,
+ canvas->drawSprite(bm,
layer->srcIR().fLeft + layer->offset().fX,
layer->srcIR().fTop + layer->offset().fY,
layer->paint());
@@ -60,7 +59,7 @@
ReplaceDraw(SkCanvas* canvas, GrLayerCache* layerCache,
SkPicture const* const drawablePicts[], int drawableCount,
const SkPicture* topLevelPicture,
- const SkBigPicture* picture,
+ const SkPicture* picture,
const SkMatrix& initialMatrix,
SkPicture::AbortCallback* callback,
const unsigned* opIndices, int numIndices)
@@ -77,8 +76,8 @@
}
int draw() {
- const SkBBoxHierarchy* bbh = fPicture->bbh();
- const SkRecord* record = fPicture->record();
+ const SkBBoxHierarchy* bbh = fPicture->fBBH.get();
+ const SkRecord* record = fPicture->fRecord.get();
if (NULL == record) {
return 0;
}
@@ -136,17 +135,13 @@
SkAutoCanvasMatrixPaint acmp(fCanvas, &dp.matrix, dp.paint, dp.picture->cullRect());
- if (const SkBigPicture* bp = dp.picture->asSkBigPicture()) {
- // Draw sub-pictures with the same replacement list but a different picture
- ReplaceDraw draw(fCanvas, fLayerCache,
- this->drawablePicts(), this->drawableCount(),
- fTopLevelPicture, bp, fInitialMatrix, fCallback,
- fOpIndexStack.begin(), fOpIndexStack.count());
- fNumReplaced += draw.draw();
- } else {
- // TODO: can we assume / assert this doesn't happen?
- dp.picture->playback(fCanvas, fCallback);
- }
+ // Draw sub-pictures with the same replacement list but a different picture
+ ReplaceDraw draw(fCanvas, fLayerCache,
+ this->drawablePicts(), this->drawableCount(),
+ fTopLevelPicture, dp.picture, fInitialMatrix, fCallback,
+ fOpIndexStack.begin(), fOpIndexStack.count());
+
+ fNumReplaced += draw.draw();
fOpIndexStack.pop();
}
@@ -173,7 +168,7 @@
draw_replacement_bitmap(layer, fCanvas);
- if (fPicture->bbh()) {
+ if (fPicture->fBBH.get()) {
while (fOps[fIndex] < layer->stop()) {
++fIndex;
}
@@ -195,7 +190,7 @@
SkCanvas* fCanvas;
GrLayerCache* fLayerCache;
const SkPicture* fTopLevelPicture;
- const SkBigPicture* fPicture;
+ const SkPicture* fPicture;
const SkMatrix fInitialMatrix;
SkPicture::AbortCallback* fCallback;
@@ -216,15 +211,9 @@
SkPicture::AbortCallback* callback) {
SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/);
- if (const SkBigPicture* bp = picture->asSkBigPicture()) {
- // TODO: drawablePicts?
- ReplaceDraw draw(canvas, layerCache, NULL, 0,
- bp, bp,
- initialMatrix, callback, NULL, 0);
- return draw.draw();
- } else {
- // TODO: can we assume / assert this doesn't happen?
- picture->playback(canvas, callback);
- return 0;
- }
+ // TODO: drawablePicts?
+ ReplaceDraw draw(canvas, layerCache, NULL, 0,
+ picture, picture,
+ initialMatrix, callback, NULL, 0);
+ return draw.draw();
}
« no previous file with comments | « src/gpu/GrLayerHoister.cpp ('k') | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698