aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-07 14:53:59 +0000
committerGravatar junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-07 14:53:59 +0000
commit3de7acc180e37c7c513f2b3425bd4616ea47fa57 (patch)
treee9d3c7c464f23327e37fb6670c38356e074a0b2c /src
parent24e8999b4b813d1f382e59c4b2793ce5671ea283 (diff)
Removing the SkPicture backend from SkDeferredCanvas code
Review URL: https://codereview.appspot.com/6446095 git-svn-id: http://skia.googlecode.com/svn/trunk@4974 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/utils/SkDeferredCanvas.cpp38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp
index acac47cf06..16067719a8 100644
--- a/src/utils/SkDeferredCanvas.cpp
+++ b/src/utils/SkDeferredCanvas.cpp
@@ -169,11 +169,7 @@ size_t SkDeferredCanvas::storageAllocatedForRecording() const {
}
size_t SkDeferredCanvas::freeMemoryIfPossible(size_t bytesToFree) {
-#if SK_DEFERRED_CANVAS_USES_GPIPE
return this->getDeferredDevice()->freeMemoryIfPossible(bytesToFree);
-#else
- return 0;
-#endif
}
void SkDeferredCanvas::validate() const {
@@ -518,8 +514,6 @@ SkCanvas* SkDeferredCanvas::canvasForDrawIter() {
return drawingCanvas();
}
-#if SK_DEFERRED_CANVAS_USES_GPIPE
-
// SkDeferredCanvas::DeferredPipeController
//-------------------------------------------
@@ -576,8 +570,6 @@ void SkDeferredCanvas::DeferredPipeController::reset() {
fAllocator.reset();
}
-#endif // SK_DEFERRED_CANVAS_USES_GPIPE
-
// SkDeferredCanvas::DeferredDevice
//------------------------------------
@@ -592,9 +584,7 @@ SkDeferredCanvas::DeferredDevice::DeferredDevice(
SkSafeRef(fDeviceContext);
fImmediateDevice = immediateDevice; // ref counted via fImmediateCanvas
fImmediateCanvas = SkNEW_ARGS(SkCanvas, (fImmediateDevice));
-#if SK_DEFERRED_CANVAS_USES_GPIPE
fPipeController.setPlaybackCanvas(fImmediateCanvas);
-#endif
beginRecording();
}
@@ -610,22 +600,13 @@ void SkDeferredCanvas::DeferredDevice::setMaxRecordingStorage(size_t maxStorage)
}
void SkDeferredCanvas::DeferredDevice::endRecording() {
-#if SK_DEFERRED_CANVAS_USES_GPIPE
fPipeWriter.endRecording();
fPipeController.reset();
-#else
- fPicture.endRecording();
-#endif
fRecordingCanvas = NULL;
}
void SkDeferredCanvas::DeferredDevice::beginRecording() {
-#if SK_DEFERRED_CANVAS_USES_GPIPE
fRecordingCanvas = fPipeWriter.startRecording(&fPipeController, 0);
-#else
- fRecordingCanvas = fPicture.beginRecording(fImmediateDevice->width(),
- fImmediateDevice->height());
-#endif
}
void SkDeferredCanvas::DeferredDevice::setDeviceContext(
@@ -675,26 +656,15 @@ bool SkDeferredCanvas::DeferredDevice::isFreshFrame() {
}
void SkDeferredCanvas::DeferredDevice::flushPending() {
-#if SK_DEFERRED_CANVAS_USES_GPIPE
if (!fPipeController.hasRecorded()) {
return;
}
-#else
- if (!fPicture.hasRecorded()) {
- return;
- }
-#endif
if (fDeviceContext) {
fDeviceContext->prepareForDraw();
}
-#if SK_DEFERRED_CANVAS_USES_GPIPE
fPipeWriter.flushRecording(true);
fPipeController.playback();
-#else
- fPicture.draw(fImmediateCanvas);
- this->beginRecording();
-#endif
}
void SkDeferredCanvas::DeferredDevice::flush() {
@@ -702,23 +672,16 @@ void SkDeferredCanvas::DeferredDevice::flush() {
fImmediateCanvas->flush();
}
-#if SK_DEFERRED_CANVAS_USES_GPIPE
size_t SkDeferredCanvas::DeferredDevice::freeMemoryIfPossible(size_t bytesToFree) {
return fPipeWriter.freeMemoryIfPossible(bytesToFree);
}
-#endif
size_t SkDeferredCanvas::DeferredDevice::storageAllocatedForRecording() const {
-#if SK_DEFERRED_CANVAS_USES_GPIPE
return (fPipeController.storageAllocatedForRecording()
+ fPipeWriter.storageAllocatedForRecording());
-#else
- return 0;
-#endif
}
SkCanvas* SkDeferredCanvas::DeferredDevice::recordingCanvas() {
-#if SK_DEFERRED_CANVAS_USES_GPIPE
size_t storageAllocated = this->storageAllocatedForRecording();
if (storageAllocated > fMaxRecordingStorageBytes) {
// First, attempt to reduce cache without flushing
@@ -731,7 +694,6 @@ SkCanvas* SkDeferredCanvas::DeferredDevice::recordingCanvas() {
this->freeMemoryIfPossible(~0);
}
}
-#endif
return fRecordingCanvas;
}