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

Unified Diff: src/core/SkPicturePlayback.cpp

Issue 192853002: Proposed SkCanvas API for preLoading textures to VRAM (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 9 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/SkPicturePlayback.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/core/SkPicturePlayback.cpp
===================================================================
--- src/core/SkPicturePlayback.cpp (revision 13719)
+++ src/core/SkPicturePlayback.cpp (working copy)
@@ -725,7 +725,7 @@
// The activeOps parameter is actually "const SkTDArray<SkPictureStateTree::Draw*>&".
// It represents the operations about to be drawn, as generated by some spatial
// subdivision helper class. It should already be in 'fOffset' sorted order.
-void SkPicturePlayback::preLoadBitmaps(const SkTDArray<void*>& activeOps) {
+void SkPicturePlayback::preLoadBitmaps(SkCanvas& canvas, const SkTDArray<void*>& activeOps) {
if (0 == activeOps.count() || NULL == fBitmapUseOffsets) {
return;
}
@@ -762,7 +762,8 @@
}
for (int i = 0; i < active.count(); ++i) {
- SkDebugf("preload texture %d\n", active[i]);
+ SkASSERT(SkBitmapHeap::INVALID_SLOT != active[i]);
+ canvas.internalPrivate_PreLoad((*fBitmaps)[active[i]], SkIRect::MakeWH(0, 0));
}
}
@@ -815,7 +816,7 @@
reader.setOffset(skipTo);
}
- this->preLoadBitmaps(activeOps);
+ this->preLoadBitmaps(canvas, activeOps);
// Record this, so we can concat w/ it if we encounter a setMatrix()
SkMatrix initialMatrix = canvas.getTotalMatrix();
« no previous file with comments | « src/core/SkPicturePlayback.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698