aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrStyle.h
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-04-26 08:41:47 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-26 08:41:47 -0700
commit82ecc5773faa0068186557f8ab2957620a7d72ea (patch)
tree45b27325b72474a44b70b52ef88cc4a85516cbd6 /src/gpu/GrStyle.h
parentcda08f84907136186ee2dcfde1dd04a8531e5315 (diff)
Revert of Add initial implementation of GrShape and GrStyle classes and tests (patchset #11 id:280001 of https://codereview.chromium.org/1822723003/ )
Reason for revert: test failing Original issue's description: > Add initial implementation of GrShape and GrStyle classes and tests > > The initial intent is to use GrShape to simplify the mask blur code paths. However, I also want to use this to explore a more unified drawing code flow for different geometry types. The goal is to have a single representation for geometries+styling that attempts to always keep the geometry in the simplest form (e.g. preferring rrects to paths). It also allows for converting styling information into modified geometry and for computing consistent keys. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1822723003 > > Committed: https://skia.googlesource.com/skia/+/c885dacfe4625af8b0e2e5c6e8a8ae8dc2d620a8 > > Committed: https://skia.googlesource.com/skia/+/824e58fc6df8fc149d9675f577f7deeaba698b09 TBR=robertphillips@google.com,egdaniel@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1919243002
Diffstat (limited to 'src/gpu/GrStyle.h')
-rw-r--r--src/gpu/GrStyle.h92
1 files changed, 0 insertions, 92 deletions
diff --git a/src/gpu/GrStyle.h b/src/gpu/GrStyle.h
deleted file mode 100644
index 4eef252de4..0000000000
--- a/src/gpu/GrStyle.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2016 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef GrStyle_DEFINED
-#define GrStyle_DEFINED
-
-#include "GrTypes.h"
-#include "SkPathEffect.h"
-#include "SkStrokeRec.h"
-#include "SkTemplates.h"
-
-/**
- * Represents the various ways that a GrShape can be styled. It has fill/stroking information
- * as well as an optional path effect. If the path effect represents dashing, the dashing
- * information is extracted from the path effect and stored explicitly.
- *
- * This object does not support stroke-and-fill styling. It is expected that stroking and filling
- * is handled by drawing a stroke and a fill separately.
- *
- * This will replace GrStrokeInfo as GrShape is deployed.
- */
-class GrStyle {
-public:
- GrStyle() : fStrokeRec(SkStrokeRec::kFill_InitStyle) {
- fDashInfo.fType = SkPathEffect::kNone_DashType;
- }
-
- GrStyle(const SkStrokeRec& strokeRec, SkPathEffect* pe) : fStrokeRec(strokeRec) {
- SkASSERT(SkStrokeRec::kStrokeAndFill_Style != strokeRec.getStyle());
- this->initPathEffect(pe);
- }
-
- GrStyle(const GrStyle& that) : fStrokeRec(SkStrokeRec::kFill_InitStyle) {
- *this = that;
- }
-
- explicit GrStyle(const SkPaint& paint) : fStrokeRec(paint) {
- SkASSERT(SkStrokeRec::kStrokeAndFill_Style != fStrokeRec.getStyle());
- this->initPathEffect(paint.getPathEffect());
- }
-
- GrStyle& operator=(const GrStyle& that) {
- fPathEffect = that.fPathEffect;
- fDashInfo = that.fDashInfo;
- fStrokeRec = that.fStrokeRec;
- return *this;
- }
- SkPathEffect* pathEffect() const { return fPathEffect.get(); }
-
- bool isDashed() const { return SkPathEffect::kDash_DashType == fDashInfo.fType; }
- SkScalar dashPhase() const {
- SkASSERT(this->isDashed());
- return fDashInfo.fPhase;
- }
- int dashIntervalCnt() const {
- SkASSERT(this->isDashed());
- return fDashInfo.fIntervals.count();
- }
- const SkScalar* dashIntervals() const {
- SkASSERT(this->isDashed());
- return fDashInfo.fIntervals.get();
- }
-
- const SkStrokeRec& strokeRec() const { return fStrokeRec; }
-
-private:
- void initPathEffect(SkPathEffect* pe);
-
- struct DashInfo {
- DashInfo& operator=(const DashInfo& that) {
- fType = that.fType;
- fPhase = that.fPhase;
- fIntervals.reset(that.fIntervals.count());
- memcpy(fIntervals.get(), that.fIntervals.get(),
- sizeof(SkScalar) * that.fIntervals.count());
- return *this;
- }
- SkPathEffect::DashType fType;
- SkScalar fPhase;
- SkAutoSTArray<4, SkScalar> fIntervals;
- };
-
- SkStrokeRec fStrokeRec;
- sk_sp<SkPathEffect> fPathEffect;
- DashInfo fDashInfo;
-};
-
-#endif