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

Unified Diff: src/views/animated/SkProgressBarView.cpp

Issue 1745813002: remove unused view files (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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/views/animated/SkImageView.cpp ('k') | src/views/animated/SkScrollBarView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/views/animated/SkProgressBarView.cpp
diff --git a/src/views/animated/SkProgressBarView.cpp b/src/views/animated/SkProgressBarView.cpp
deleted file mode 100644
index 5ce944fb07120a0b4d23c74445c38779146e2f9e..0000000000000000000000000000000000000000
--- a/src/views/animated/SkProgressBarView.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-
-/*
- * Copyright 2011 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#include "SkProgressBarView.h"
-#include "SkAnimator.h"
-#include "SkWidgetViews.h"
-#include "SkTime.h"
-#include "SkSystemEventTypes.h"
-
-SkProgressBarView::SkProgressBarView()
-{
- init_skin_anim(kProgress_SkinEnum, &fAnim);
- fAnim.setHostEventSink(this);
- fProgress = 0;
- fMax = 100;
-
-}
-
-void SkProgressBarView::changeProgress(int diff)
-{
- int newProg = fProgress + diff;
- if (newProg > 0 && newProg < fMax)
- this->setProgress(newProg);
- //otherwise i'll just leave it as it is
- //this implies that if a new max and progress are set, max must be set first
-}
-
-/*virtual*/ void SkProgressBarView::onDraw(SkCanvas* canvas)
-{
- SkPaint paint;
- SkAnimator::DifferenceType diff = fAnim.draw(canvas, &paint, SkTime::GetMSecs());
-
- if (diff == SkAnimator::kDifferent)
- this->inval(nullptr);
- else if (diff == SkAnimator::kPartiallyDifferent)
- {
- SkRect bounds;
- fAnim.getInvalBounds(&bounds);
- this->inval(&bounds);
- }
-}
-
-/*virtual*/ bool SkProgressBarView::onEvent(const SkEvent& evt)
-{
- if (evt.isType(SK_EventType_Inval))
- {
- this->inval(nullptr);
- return true;
- }
- if (evt.isType("recommendDim"))
- {
- SkScalar height;
-
- if (evt.findScalar("y", &height))
- this->setHeight(height);
- return true;
- }
- return this->INHERITED::onEvent(evt);
-}
-
-/*virtual*/ void SkProgressBarView::onInflate(const SkDOM& dom, const SkDOM::Node* node)
-{
- this->INHERITED::onInflate(dom, node);
- int32_t temp;
- if (dom.findS32(node, "max", &temp))
- this->setMax(temp);
- if (dom.findS32(node, "progress", &temp))
- this->setProgress(temp);
-}
-
-/*virtual*/ void SkProgressBarView::onSizeChange()
-{
- this->INHERITED::onSizeChange();
- SkEvent evt("user");
- evt.setString("id", "setDim");
- evt.setScalar("dimX", this->width());
- evt.setScalar("dimY", this->height());
- fAnim.doUserEvent(evt);
-}
-
-void SkProgressBarView::reset()
-{
- fProgress = 0;
- SkEvent e("user");
- e.setString("id", "reset");
- fAnim.doUserEvent(e);
-}
-
-void SkProgressBarView::setMax(int max)
-{
- fMax = max;
- SkEvent e("user");
- e.setString("id", "setMax");
- e.setS32("newMax", max);
- fAnim.doUserEvent(e);
-}
-
-void SkProgressBarView::setProgress(int progress)
-{
- fProgress = progress;
- SkEvent e("user");
- e.setString("id", "setProgress");
- e.setS32("newProgress", progress);
- fAnim.doUserEvent(e);
-}
« no previous file with comments | « src/views/animated/SkImageView.cpp ('k') | src/views/animated/SkScrollBarView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698