aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrRenderTargetContext.cpp
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2018-07-28 18:07:54 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-31 13:52:20 +0000
commit74c6ed3d1f179209ec90025532310d9c8151999f (patch)
tree2d20cc433c2136b8a1832698e9c14118615696dc /src/gpu/GrRenderTargetContext.cpp
parent0bf5408286ea3dacb197c220e1033dea3eeef2a8 (diff)
Move one leaf loop from GPU to glyph drawer
Encapsulate the bitmap inner loop of regenerate in the SkGlyphRunListDrawer. This changed required placing an SkGlyphRunListDrawer in the two TextTargets. Change-Id: I7ef7a2d0074fe898fce4da82d26ea1f47e1f7a98 Reviewed-on: https://skia-review.googlesource.com/144302 Reviewed-by: Jim Van Verth <jvanverth@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'src/gpu/GrRenderTargetContext.cpp')
-rw-r--r--src/gpu/GrRenderTargetContext.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index a67e19a9d9..fd515c7ec7 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -27,6 +27,7 @@
#include "GrStyle.h"
#include "GrTracing.h"
#include "SkDrawShadowInfo.h"
+#include "SkGlyphRun.h"
#include "SkGr.h"
#include "SkLatticeIter.h"
#include "SkMatrixPriv.h"
@@ -53,12 +54,15 @@
#include "text/GrTextContext.h"
#include "text/GrTextUtils.h"
+
+
class GrRenderTargetContext::TextTarget : public GrTextUtils::Target {
public:
TextTarget(GrRenderTargetContext* renderTargetContext)
: Target(renderTargetContext->width(), renderTargetContext->height(),
renderTargetContext->colorSpaceInfo())
- , fRenderTargetContext(renderTargetContext) {}
+ , fRenderTargetContext(renderTargetContext)
+ , fGlyphDrawer{*renderTargetContext}{}
void addDrawOp(const GrClip& clip, std::unique_ptr<GrAtlasTextOp> op) override {
fRenderTargetContext->addDrawOp(clip, std::move(op));
@@ -87,8 +91,14 @@ public:
return fRenderTargetContext->fContext;
}
+ SkGlyphRunListDrawer* glyphDrawer() override {
+ return &fGlyphDrawer;
+ }
+
private:
GrRenderTargetContext* fRenderTargetContext;
+ SkGlyphRunListDrawer fGlyphDrawer;
+
};
#define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == this->drawingManager()->getContext())