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

Unified Diff: src/gpu/GrLayerHoister.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/core/SkRecords.h ('k') | src/gpu/GrRecordReplaceDraw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrLayerHoister.cpp
diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp
index 67e3c19a2fc6425e49a60b9db3884d60d2df4c10..70c10d7f69db1e62e84a60437406ed23d762c57e 100644
--- a/src/gpu/GrLayerHoister.cpp
+++ b/src/gpu/GrLayerHoister.cpp
@@ -9,7 +9,6 @@
#include "GrLayerHoister.h"
#include "GrRecordReplaceDraw.h"
-#include "SkBigPicture.h"
#include "SkCanvas.h"
#include "SkDeviceImageFilterProxy.h"
#include "SkDeviceProperties.h"
@@ -22,7 +21,7 @@
// Create the layer information for the hoisted layer and secure the
// required texture/render target resources.
-static void prepare_for_hoisting(GrLayerCache* layerCache,
+static void prepare_for_hoisting(GrLayerCache* layerCache,
const SkPicture* topLevelPicture,
const SkMatrix& initialMat,
const SkLayerInfo::BlockInfo& info,
@@ -75,7 +74,7 @@
} else {
hl = recycled->append();
}
-
+
layerCache->addUse(layer);
hl->fLayer = layer;
hl->fPicture = pict;
@@ -130,12 +129,12 @@
}
GrLayerCache* layerCache = context->getLayerCache();
+
layerCache->processDeletedPictures();
- const SkBigPicture::AccelData* topLevelData = NULL;
- if (const SkBigPicture* bp = topLevelPicture->asSkBigPicture()) {
- topLevelData = bp->accelData();
- }
+ SkPicture::AccelData::Key key = SkLayerInfo::ComputeKey();
+
+ const SkPicture::AccelData* topLevelData = topLevelPicture->EXPERIMENTAL_getAccelData(key);
if (!topLevelData) {
return;
}
@@ -190,10 +189,9 @@
layerCache->processDeletedPictures();
- const SkBigPicture::AccelData* topLevelData = NULL;
- if (const SkBigPicture* bp = topLevelPicture->asSkBigPicture()) {
- topLevelData = bp->accelData();
- }
+ SkPicture::AccelData::Key key = SkLayerInfo::ComputeKey();
+
+ const SkPicture::AccelData* topLevelData = topLevelPicture->EXPERIMENTAL_getAccelData(key);
if (!topLevelData) {
return;
}
@@ -241,11 +239,7 @@
for (int i = 0; i < atlased.count(); ++i) {
const GrCachedLayer* layer = atlased[i].fLayer;
- const SkBigPicture* pict = atlased[i].fPicture->asSkBigPicture();
- if (!pict) {
- // TODO: can we assume / assert this?
- continue;
- }
+ const SkPicture* pict = atlased[i].fPicture;
const SkIPoint offset = SkIPoint::Make(layer->srcIR().fLeft, layer->srcIR().fTop);
SkDEBUGCODE(const SkPaint* layerPaint = layer->paint();)
@@ -271,7 +265,10 @@
atlasCanvas->setMatrix(initialCTM);
atlasCanvas->concat(atlased[i].fLocalMat);
- pict->partialPlayback(atlasCanvas, layer->start() + 1, layer->stop(), initialCTM);
+ SkRecordPartialDraw(*pict->fRecord.get(), atlasCanvas,
+ pict->drawablePicts(), pict->drawableCount(),
+ layer->start() + 1, layer->stop(), initialCTM);
+
atlasCanvas->restore();
}
@@ -331,11 +328,7 @@
void GrLayerHoister::DrawLayers(GrContext* context, const SkTDArray<GrHoistedLayer>& layers) {
for (int i = 0; i < layers.count(); ++i) {
GrCachedLayer* layer = layers[i].fLayer;
- const SkBigPicture* pict = layers[i].fPicture->asSkBigPicture();
- if (!pict) {
- // TODO: can we assume / assert this?
- continue;
- }
+ const SkPicture* pict = layers[i].fPicture;
const SkIPoint offset = SkIPoint::Make(layer->srcIR().fLeft, layer->srcIR().fTop);
// Each non-atlased layer has its own GrTexture
@@ -360,7 +353,10 @@
layerCanvas->setMatrix(initialCTM);
layerCanvas->concat(layers[i].fLocalMat);
- pict->partialPlayback(layerCanvas, layer->start()+1, layer->stop(), initialCTM);
+ SkRecordPartialDraw(*pict->fRecord.get(), layerCanvas,
+ pict->drawablePicts(), pict->drawableCount(),
+ layer->start()+1, layer->stop(), initialCTM);
+
layerCanvas->flush();
if (layer->filter()) {
« no previous file with comments | « src/core/SkRecords.h ('k') | src/gpu/GrRecordReplaceDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698