aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2016-10-25 09:57:13 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-10-25 14:19:07 +0000
commit7614794c9ad14d76abed6cf00890ad1a09c2cb8b (patch)
treefb79a90fe28039038d5d54e809f68e83399cb32a /gm
parent67c7c81a82b6351e9fbbf235084d7120162d9268 (diff)
remove discardablepixelref
BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3883 Change-Id: Ica284be78563a4ccd6e0cb07404064fb5511ba57 Reviewed-on: https://skia-review.googlesource.com/3883 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'gm')
-rw-r--r--gm/factory.cpp66
1 files changed, 0 insertions, 66 deletions
diff --git a/gm/factory.cpp b/gm/factory.cpp
deleted file mode 100644
index 77da3b851a..0000000000
--- a/gm/factory.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "gm.h"
-
-#include "Resources.h"
-#include "SkCanvas.h"
-#include "SkData.h"
-#include "SkDiscardableMemoryPool.h"
-#include "SkDiscardablePixelRef.h"
-#include "SkImageGeneratorPriv.h"
-#include "SkOSFile.h"
-#include "SkStream.h"
-
-namespace skiagm {
-
-/**
- * Draw a PNG created by SkBitmapFactory.
- */
-class FactoryGM : public GM {
-public:
- FactoryGM() {}
-
-protected:
- void onOnceBeforeDraw() override {
- // Copyright-free file from http://openclipart.org/detail/29213/paper-plane-by-ddoo
- SkString pngFilename = GetResourcePath("plane.png");
- sk_sp<SkData> data(SkData::MakeFromFileName(pngFilename.c_str()));
- if (data) {
- // Create a cache which will boot the pixels out anytime the
- // bitmap is unlocked.
- SkAutoTUnref<SkDiscardableMemoryPool> pool(
- SkDiscardableMemoryPool::Create(1));
- SkDEPRECATED_InstallDiscardablePixelRef(SkImageGenerator::NewFromEncoded(data.get()),
- nullptr, &fBitmap, pool);
- }
- }
-
- SkString onShortName() override {
- return SkString("factory");
- }
-
- SkISize onISize() override {
- return SkISize::Make(640, 480);
- }
-
- void onDraw(SkCanvas* canvas) override {
- canvas->drawBitmap(fBitmap, 0, 0);
- }
-
-private:
- SkBitmap fBitmap;
-
- typedef GM INHERITED;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-static GM* MyFactory(void*) { return new FactoryGM; }
-static GMRegistry reg(MyFactory);
-
-} // namespace skiagm