From 570a48c0e1a891e4c4466afa39c67acf765a999a Mon Sep 17 00:00:00 2001 From: "djsollen@google.com" Date: Mon, 10 Dec 2012 14:10:20 +0000 Subject: revert Reapply r5364 (Update ARM and NEON optimizations for S32A_Opaque_BlitRow32) git-svn-id: http://skia.googlecode.com/svn/trunk@6728 2bbb7eff-a529-9590-31e7-b0007b416f81 --- samplecode/SampleApp.cpp | 25 ++++++------------------ samplecode/SampleApp.h | 1 - samplecode/SamplePictFile.cpp | 45 +++++++------------------------------------ 3 files changed, 13 insertions(+), 58 deletions(-) (limited to 'samplecode') diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index 716998f960..cc06e04250 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -1051,10 +1051,6 @@ void SampleWindow::draw(SkCanvas* canvas) { this->updateMatrix(); } - if (fMeasureFPS) { - fMeasureFPS_Time = 0; - } - if (fNClip) { this->INHERITED::draw(canvas); SkBitmap orig = capture_bitmap(canvas); @@ -1115,11 +1111,6 @@ void SampleWindow::draw(SkCanvas* canvas) { magnify(canvas); } - if (fMeasureFPS && fMeasureFPS_Time) { - this->updateTitle(); - this->postInvalDelay(); - } - // do this last fDevManager->publishCanvas(fDeviceType, canvas, this); } @@ -1405,8 +1396,10 @@ void SampleWindow::afterChildren(SkCanvas* orig) { } // Do this after presentGL and other finishing, rather than in afterChild - if (fMeasureFPS && fMeasureFPS_StartTime) { - fMeasureFPS_Time += SkTime::GetMSecs() - fMeasureFPS_StartTime; + if (fMeasureFPS && fMeasureFPS_Time) { + fMeasureFPS_Time = SkTime::GetMSecs() - fMeasureFPS_Time; + this->updateTitle(); + this->postInvalDelay(); } // if ((fScrollTestX | fScrollTestY) != 0) @@ -1478,8 +1471,9 @@ void SampleWindow::beforeChild(SkView* child, SkCanvas* canvas) { this->installDrawFilter(canvas); if (fMeasureFPS) { + fMeasureFPS_Time = 0; // 0 means the child is not aware of repeat-draw if (SampleView::SetRepeatDraw(child, FPS_REPEAT_COUNT)) { - fMeasureFPS_StartTime = SkTime::GetMSecs(); + fMeasureFPS_Time = SkTime::GetMSecs(); } } else { (void)SampleView::SetRepeatDraw(child, 1); @@ -1784,13 +1778,6 @@ bool SampleWindow::onHandleChar(SkUnichar uni) { } switch (uni) { - case 'b': - { - postEventToSink(SkNEW_ARGS(SkEvent, ("PictFileView::toggleBBox")), curr_view(this)); - this->updateTitle(); - this->inval(NULL); - break; - } case 'B': // gIgnoreFastBlurRect = !gIgnoreFastBlurRect; this->inval(NULL); diff --git a/samplecode/SampleApp.h b/samplecode/SampleApp.h index 2308a121ab..85392e0c9a 100644 --- a/samplecode/SampleApp.h +++ b/samplecode/SampleApp.h @@ -168,7 +168,6 @@ private: bool fRequestGrabImage; bool fMeasureFPS; SkMSec fMeasureFPS_Time; - SkMSec fMeasureFPS_StartTime; bool fMagnify; SkISize fTileCount; diff --git a/samplecode/SamplePictFile.cpp b/samplecode/SamplePictFile.cpp index b53ba83600..22c81d1d94 100644 --- a/samplecode/SamplePictFile.cpp +++ b/samplecode/SamplePictFile.cpp @@ -13,7 +13,6 @@ #include "SkGradientShader.h" #include "SkGraphics.h" #include "SkImageDecoder.h" -#include "SkOSFile.h" #include "SkPath.h" #include "SkPicture.h" #include "SkRandom.h" @@ -32,10 +31,8 @@ class PictFileView : public SampleView { SkString fFilename; SkPicture* fPicture; - SkPicture* fBBoxPicture; - bool fUseBBox; - static SkPicture* LoadPicture(const char path[], bool useBBox) { + static SkPicture* LoadPicture(const char path[]) { SkPicture* pic = NULL; SkBitmap bm; @@ -63,30 +60,16 @@ class PictFileView : public SampleView { p2.serialize(&writer); } } - - if (useBBox) { - SkPicture* bboxPicture = SkNEW(SkPicture); - pic->draw(bboxPicture->beginRecording(pic->width(), pic->height(), - SkPicture::kOptimizeForClippedPlayback_RecordingFlag)); - bboxPicture->endRecording(); - SkDELETE(pic); - return bboxPicture; - - } else { - return pic; - } + return pic; } public: PictFileView(const char name[] = NULL) : fFilename(name) { fPicture = NULL; - fBBoxPicture = NULL; - fUseBBox = false; } virtual ~PictFileView() { SkSafeUnref(fPicture); - SkSafeUnref(fBBoxPicture); } protected: @@ -94,33 +77,19 @@ protected: virtual bool onQuery(SkEvent* evt) { if (SampleCode::TitleQ(*evt)) { SkString name("P:"); - const char* basename = strrchr(fFilename.c_str(), SkPATH_SEPARATOR); - name.append(basename ? basename+1: fFilename.c_str()); - if (fUseBBox) { - name.append(" "); - } + name.append(fFilename); SampleCode::TitleR(evt, name.c_str()); return true; } return this->INHERITED::onQuery(evt); } - virtual bool onEvent(const SkEvent& evt) { - if (evt.isType("PictFileView::toggleBBox")) { - fUseBBox = !fUseBBox; - return true; - } - return this->INHERITED::onEvent(evt); - } - virtual void onDrawContent(SkCanvas* canvas) { - SkPicture** picture = fUseBBox ? &fBBoxPicture : &fPicture; - - if (!*picture) { - *picture = LoadPicture(fFilename.c_str(), fUseBBox); + if (!fPicture) { + fPicture = LoadPicture(fFilename.c_str()); } - if (*picture) { - canvas->drawPicture(**picture); + if (fPicture) { + canvas->drawPicture(*fPicture); } } -- cgit v1.2.3