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

Unified Diff: src/gpu/GrTextContext.cpp

Issue 939623005: Pass Rendertarget into context (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: sampleapp Created 5 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/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 bc544ad4a00f0623d0ede6efc76c097bc2167e02..c909aac2f96f734bf51279f42a7cac1b6c5b4e67 100644
--- a/src/gpu/GrTextContext.cpp
+++ b/src/gpu/GrTextContext.cpp
@@ -21,12 +21,12 @@ GrTextContext::~GrTextContext() {
SkDELETE(fFallbackTextContext);
}
-void GrTextContext::init(const GrPaint& grPaint, const SkPaint& skPaint) {
+void GrTextContext::init(GrRenderTarget* rt, const GrPaint& grPaint, const SkPaint& skPaint) {
const GrClipData* clipData = fContext->getClip();
- clipData->getConservativeBounds(fContext->getRenderTarget()->width(),
- fContext->getRenderTarget()->height(),
- &fClipRect);
+ fRenderTarget.reset(SkRef(rt));
+
+ clipData->getConservativeBounds(fRenderTarget->width(), fRenderTarget->height(), &fClipRect);
fDrawTarget = fContext->getTextTarget();
@@ -34,7 +34,7 @@ void GrTextContext::init(const GrPaint& grPaint, const SkPaint& skPaint) {
fSkPaint = skPaint;
}
-bool GrTextContext::drawText(const GrPaint& paint, const SkPaint& skPaint,
+bool GrTextContext::drawText(GrRenderTarget* rt, const GrPaint& paint, const SkPaint& skPaint,
const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
SkScalar x, SkScalar y) {
@@ -42,7 +42,7 @@ bool GrTextContext::drawText(const GrPaint& paint, const SkPaint& skPaint,
GrTextContext* textContext = this;
do {
if (textContext->canDraw(skPaint, viewMatrix)) {
- textContext->onDrawText(paint, skPaint, viewMatrix, text, byteLength, x, y);
+ textContext->onDrawText(rt, paint, skPaint, viewMatrix, text, byteLength, x, y);
return true;
}
textContext = textContext->fFallbackTextContext;
@@ -51,7 +51,7 @@ bool GrTextContext::drawText(const GrPaint& paint, const SkPaint& skPaint,
return false;
}
-bool GrTextContext::drawPosText(const GrPaint& paint, const SkPaint& skPaint,
+bool GrTextContext::drawPosText(GrRenderTarget* rt, const GrPaint& paint, const SkPaint& skPaint,
const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
const SkScalar pos[], int scalarsPerPosition,
@@ -60,7 +60,7 @@ bool GrTextContext::drawPosText(const GrPaint& paint, const SkPaint& skPaint,
GrTextContext* textContext = this;
do {
if (textContext->canDraw(skPaint, viewMatrix)) {
- textContext->onDrawPosText(paint, skPaint, viewMatrix, text, byteLength, pos,
+ textContext->onDrawPosText(rt, paint, skPaint, viewMatrix, text, byteLength, pos,
scalarsPerPosition, offset);
return true;
}
« 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