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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 540543002: Switch Layer Hoisting over to SkRecord backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 6a7748f88b09e95b66e812fa0be00c836b1948ad..375d0e68b3538963fc1a285a8cc35e5e14b989e1 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -18,6 +18,7 @@
#include "GrLayerCache.h"
#include "GrLayerHoister.h"
#include "GrPictureUtils.h"
+#include "GrRecordReplaceDraw.h"
#include "GrStrokeInfo.h"
#include "GrTracing.h"
@@ -31,8 +32,7 @@
#include "SkPathEffect.h"
#include "SkPicture.h"
#include "SkPictureData.h"
-#include "SkPictureRangePlayback.h"
-#include "SkPictureReplacementPlayback.h"
+#include "SkRecord.h"
#include "SkRRect.h"
#include "SkStroke.h"
#include "SkSurface.h"
@@ -1875,7 +1875,7 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
return false;
}
- SkPictureReplacementPlayback::PlaybackReplacements replacements;
+ GrReplacements replacements;
SkTDArray<GrCachedLayer*> atlased, nonAtlased;
atlased.setReserve(gpuData->numSaveLayers());
@@ -1890,8 +1890,7 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
info.fRestoreOpID,
info.fOriginXform);
- SkPictureReplacementPlayback::PlaybackReplacements::ReplacementInfo* layerInfo =
- replacements.push();
+ GrReplacements::ReplacementInfo* layerInfo = replacements.push();
layerInfo->fStart = info.fSaveLayerOpID;
layerInfo->fStop = info.fRestoreOpID;
layerInfo->fPos = info.fOffset;
@@ -1909,11 +1908,12 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
continue;
}
- layerInfo->fBM = SkNEW(SkBitmap); // fBM is allocated so ReplacementInfo can be POD
+ SkBitmap bm;
wrap_texture(layer->texture(),
!layer->isAtlased() ? desc.fWidth : layer->texture()->width(),
!layer->isAtlased() ? desc.fHeight : layer->texture()->height(),
- layerInfo->fBM);
+ &bm);
+ layerInfo->fImage = SkImage::NewTexture(bm);
SkASSERT(info.fPaint);
layerInfo->fPaint = info.fPaint;
@@ -1936,9 +1936,7 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
GrLayerHoister::DrawLayers(picture, atlased, nonAtlased);
// Render the entire picture using new layers
- SkPictureReplacementPlayback playback(picture, &replacements, NULL);
-
- playback.draw(mainCanvas, NULL);
+ GrRecordReplaceDraw(*picture->fRecord, mainCanvas, picture->fBBH.get(), &replacements, NULL);
GrLayerHoister::UnlockLayers(fContext->getLayerCache(), picture);
« no previous file with comments | « src/gpu/GrRecordReplaceDraw.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698