anticipate more optimizations by renaming some files and methods

also, call the new SkRecordOptimize in bench_playback

BUG=skia:2378
R=fmalita@chromium.org, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/243243003

git-svn-id: http://skia.googlecode.com/svn/trunk@14277 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2014-04-21 15:03:36 +00:00
Родитель 5da5b59764
Коммит ad8ce572f6
7 изменённых файлов: 22 добавлений и 11 удалений

Просмотреть файл

@ -14,7 +14,7 @@
],
},
'sources': [
'../src/record/SkRecordCulling.cpp',
'../src/record/SkRecordOpts.cpp',
'../src/record/SkRecordDraw.cpp',
'../src/record/SkRecorder.cpp',
'../src/record/SkRecording.cpp',

Просмотреть файл

@ -5,11 +5,15 @@
* found in the LICENSE file.
*/
#include "SkRecordCulling.h"
#include "SkRecordOpts.h"
#include "SkRecords.h"
#include "SkTDArray.h"
void SkRecordOptimize(SkRecord* record) {
SkRecordAnnotateCullingPairs(record);
}
namespace {
struct Annotator {

Просмотреть файл

@ -5,12 +5,16 @@
* found in the LICENSE file.
*/
#ifndef SkRecordCulling_DEFINED
#define SkRecordCulling_DEFINED
#ifndef SkRecordOpts_DEFINED
#define SkRecordOpts_DEFINED
#include "SkRecord.h"
// Annotates PushCull records in record with the relative offset of their paired PopCull.
void SkRecordAnnotateCullingPairs(SkRecord* record);
// Run all optimizations in recommended order.
void SkRecordOptimize(SkRecord*);
#endif//SkRecordCulling_DEFINED
// Annotates PushCull records in record with the relative offset of their paired PopCull.
void SkRecordAnnotateCullingPairs(SkRecord*);
#endif//SkRecordOpts_DEFINED

Просмотреть файл

@ -8,7 +8,7 @@
#include "SkRecording.h"
#include "SkRecord.h"
#include "SkRecordCulling.h"
#include "SkRecordOpts.h"
#include "SkRecordDraw.h"
#include "SkRecorder.h"
@ -37,7 +37,7 @@ SkRecording::SkRecording(int width, int height) {
/*static*/ const SkPlayback* SkRecording::Delete(SkRecording* recording) {
SkRecord* record = recording->fRecord;
SkRecordAnnotateCullingPairs(record);
SkRecordOptimize(record);
SkDELETE(recording);
return SkNEW_ARGS(SkPlayback, (record));
}

Просмотреть файл

@ -8,7 +8,7 @@
#include "Test.h"
#include "SkRecord.h"
#include "SkRecordCulling.h"
#include "SkRecordOpts.h"
#include "SkRecorder.h"
#include "SkRecords.h"

Просмотреть файл

@ -9,7 +9,7 @@
#include "SkDebugCanvas.h"
#include "SkRecord.h"
#include "SkRecordCulling.h"
#include "SkRecordOpts.h"
#include "SkRecordDraw.h"
#include "SkRecorder.h"
#include "SkRecords.h"

Просмотреть файл

@ -11,6 +11,7 @@
#include "SkOSFile.h"
#include "SkPicture.h"
#include "SkRecordDraw.h"
#include "SkRecordOpts.h"
#include "SkRecorder.h"
#include "SkStream.h"
#include "SkString.h"
@ -31,6 +32,8 @@ static void bench(SkPMColor* scratch, SkPicture& src, const char* name) {
SkRecorder recorder(SkRecorder::kWriteOnly_Mode, &record, src.width(), src.height());
src.draw(&recorder);
SkRecordOptimize(&record);
SkAutoTDelete<SkCanvas> canvas(SkCanvas::NewRasterDirectN32(src.width(),
src.height(),
scratch,