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

Unified Diff: src/gpu/GrTextContext.cpp

Issue 936943002: Pass clip to context (Closed) Base URL: https://skia.googlesource.com/skia.git@pass_down_rendertarget
Patch Set: feedback inc 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.h » ('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 895e97752b81fc1e322fbba4349cbc15e6ad6149..cef99c6c45de33479ddccfec1f2e30ae7eb8a218 100644
--- a/src/gpu/GrTextContext.cpp
+++ b/src/gpu/GrTextContext.cpp
@@ -7,10 +7,11 @@
#include "GrTextContext.h"
#include "GrContext.h"
+#include "GrDrawTarget.h"
+#include "GrFontScaler.h"
#include "SkAutoKern.h"
#include "SkGlyphCache.h"
-#include "GrFontScaler.h"
GrTextContext::GrTextContext(GrContext* context, const SkDeviceProperties& properties) :
fFallbackTextContext(NULL),
@@ -21,12 +22,13 @@ GrTextContext::~GrTextContext() {
SkDELETE(fFallbackTextContext);
}
-void GrTextContext::init(GrRenderTarget* rt, const GrPaint& grPaint, const SkPaint& skPaint) {
- fClip = fContext->getClip();
+void GrTextContext::init(GrRenderTarget* rt, const GrClip& clip, const GrPaint& grPaint,
+ const SkPaint& skPaint) {
+ fClip = clip;
fRenderTarget.reset(SkRef(rt));
- fClip->getConservativeBounds(fRenderTarget->width(), fRenderTarget->height(), &fClipRect);
jvanverth1 2015/02/24 21:52:08 Just wondering if we could remove fClipRect as a m
+ fClip.getConservativeBounds(fRenderTarget->width(), fRenderTarget->height(), &fClipRect);
fDrawTarget = fContext->getTextTarget();
@@ -34,15 +36,15 @@ void GrTextContext::init(GrRenderTarget* rt, const GrPaint& grPaint, const SkPai
fSkPaint = skPaint;
}
-bool GrTextContext::drawText(GrRenderTarget* rt, const GrPaint& paint, const SkPaint& skPaint,
- const SkMatrix& viewMatrix,
+bool GrTextContext::drawText(GrRenderTarget* rt, const GrClip& clip, const GrPaint& paint,
+ const SkPaint& skPaint, const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
SkScalar x, SkScalar y) {
GrTextContext* textContext = this;
do {
if (textContext->canDraw(skPaint, viewMatrix)) {
- textContext->onDrawText(rt, paint, skPaint, viewMatrix, text, byteLength, x, y);
+ textContext->onDrawText(rt, clip, paint, skPaint, viewMatrix, text, byteLength, x, y);
return true;
}
textContext = textContext->fFallbackTextContext;
@@ -51,8 +53,8 @@ bool GrTextContext::drawText(GrRenderTarget* rt, const GrPaint& paint, const SkP
return false;
}
-bool GrTextContext::drawPosText(GrRenderTarget* rt, const GrPaint& paint, const SkPaint& skPaint,
- const SkMatrix& viewMatrix,
+bool GrTextContext::drawPosText(GrRenderTarget* rt, const GrClip& clip, const GrPaint& paint,
+ const SkPaint& skPaint, const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
const SkScalar pos[], int scalarsPerPosition,
const SkPoint& offset) {
@@ -60,7 +62,7 @@ bool GrTextContext::drawPosText(GrRenderTarget* rt, const GrPaint& paint, const
GrTextContext* textContext = this;
do {
if (textContext->canDraw(skPaint, viewMatrix)) {
- textContext->onDrawPosText(rt, paint, skPaint, viewMatrix, text, byteLength, pos,
+ textContext->onDrawPosText(rt, clip, paint, skPaint, viewMatrix, text, byteLength, pos,
scalarsPerPosition, offset);
return true;
}
« no previous file with comments | « src/gpu/GrTextContext.h ('k') | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698