diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-04-11 15:54:14 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-04-11 15:54:14 +0000 |
commit | c873329ae9ff00b0c45f7294172ad2e9b1ec44c8 (patch) | |
tree | 097af473a93308c68cf5aebaebf51abd1722034b /src | |
parent | 0bd03cf38cc61ab78c09eb83f4564e34a3d7415f (diff) |
Update bench to be able to preprocess skps
This allows benchmarking of optimization improvements and plumbs in the purging API. The purging is necessary so we don't magically get faster because the saveLayers are always pre-generated.
R=jvanverth@google.com, reed@google.com
Author: robertphillips@google.com
Review URL: https://codereview.chromium.org/233663002
git-svn-id: http://skia.googlecode.com/svn/trunk@14154 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkCanvas.cpp | 9 | ||||
-rw-r--r-- | src/core/SkDevice.cpp | 7 | ||||
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 6 |
3 files changed, 19 insertions, 3 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index c16ac9a09f..8d35eaedf9 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -2542,12 +2542,19 @@ void SkCanvas::EXPERIMENTAL_optimize(SkPicture* picture) { } } +void SkCanvas::EXPERIMENTAL_purge(SkPicture* picture) { + SkBaseDevice* device = this->getTopDevice(); + if (NULL != device) { + device->EXPERIMENTAL_purge(picture); + } +} + void SkCanvas::drawPicture(SkPicture& picture) { SkBaseDevice* device = this->getTopDevice(); if (NULL != device) { // Canvas has to first give the device the opportunity to render // the picture itself. - if (device->EXPERIMENTAL_drawPicture(&picture)) { + if (device->EXPERIMENTAL_drawPicture(this, &picture)) { return; // the device has rendered the entire picture } } diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp index 255ad02e08..f8a7115aa8 100644 --- a/src/core/SkDevice.cpp +++ b/src/core/SkDevice.cpp @@ -135,7 +135,12 @@ void SkBaseDevice::EXPERIMENTAL_optimize(SkPicture* picture) { // The base class doesn't perform any analysis but derived classes may } -bool SkBaseDevice::EXPERIMENTAL_drawPicture(SkPicture* picture) { +void SkBaseDevice::EXPERIMENTAL_purge(SkPicture* picture) { + // Derived-classes may have data to purge but not the base class +} + +bool SkBaseDevice::EXPERIMENTAL_drawPicture(SkCanvas* canvas, SkPicture* picture) { // The base class doesn't perform any accelerated picture rendering return false; } + diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 911ac5a235..7c804ab2a0 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1918,7 +1918,11 @@ void SkGpuDevice::EXPERIMENTAL_optimize(SkPicture* picture) { GatherGPUInfo(picture, data); } -bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkPicture* picture) { +void SkGpuDevice::EXPERIMENTAL_purge(SkPicture* picture) { + +} + +bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* canvas, SkPicture* picture) { SkPicture::AccelData::Key key = ComputeAccelDataKey(); |