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

Unified Diff: src/gpu/GrTextContext.cpp

Issue 150743002: Replace factory generation of TextContexts with persistent objects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: And an if statement Created 6 years, 11 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/gpu/GrTextContext.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTextContext.cpp
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp
index 0c9e149f750988cf3dd7e4478362b32a78368844..bc116714dad02b1d2a5393518bc9bd918cb5e451 100644
--- a/src/gpu/GrTextContext.cpp
+++ b/src/gpu/GrTextContext.cpp
@@ -12,24 +12,27 @@
#include "SkGlyphCache.h"
#include "SkGr.h"
-GrTextContext::GrTextContext(GrContext* context, const GrPaint& paint,
- const SkPaint& skPaint, const SkDeviceProperties& properties) :
- fContext(context), fPaint(paint), fSkPaint(skPaint),
- fDeviceProperties(properties) {
+GrTextContext::GrTextContext(GrContext* context, const SkDeviceProperties& properties) :
+ fContext(context), fDeviceProperties(properties), fDrawTarget(NULL) {
+}
- const GrClipData* clipData = context->getClip();
+void GrTextContext::init(const GrPaint& grPaint, const SkPaint& skPaint) {
+ const GrClipData* clipData = fContext->getClip();
SkRect devConservativeBound;
clipData->fClipStack->getConservativeBounds(
-clipData->fOrigin.fX,
-clipData->fOrigin.fY,
- context->getRenderTarget()->width(),
- context->getRenderTarget()->height(),
+ fContext->getRenderTarget()->width(),
+ fContext->getRenderTarget()->height(),
&devConservativeBound);
devConservativeBound.roundOut(&fClipRect);
- fDrawTarget = context->getTextTarget();
+ fDrawTarget = fContext->getTextTarget();
+
+ fPaint = grPaint;
+ fSkPaint = skPaint;
}
//*** change to output positions?
« no previous file with comments | « src/gpu/GrTextContext.h ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698