aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/SkGpuDevice.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-03-14 14:39:29 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-14 21:23:44 +0000
commit26c90e04797e15c37ec00e0f836292b8a207d294 (patch)
treec5a86abbf8cfa796a87df49a157de0e12de18f87 /src/gpu/SkGpuDevice.cpp
parent97180af7f5e577a451367aa0c15cfaff1b6076f5 (diff)
Add GrRenderTargetContext::resourceProvider & GrResourceProvider::caps
and retract GrSurfaceContextPriv a bit Change-Id: Id47af1052f9bda4fe7c85b3ce46b3ebe37797524 Reviewed-on: https://skia-review.googlesource.com/9647 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/SkGpuDevice.cpp')
-rw-r--r--src/gpu/SkGpuDevice.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 55be407de4..5a98b08220 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -14,7 +14,6 @@
#include "GrImageTextureMaker.h"
#include "GrRenderTargetContextPriv.h"
#include "GrStyle.h"
-#include "GrSurfaceContextPriv.h"
#include "GrTextureAdjuster.h"
#include "GrTextureProxy.h"
#include "GrTracing.h"
@@ -459,7 +458,7 @@ void SkGpuDevice::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
// we used to test finalIRect for quickReject, but that seems unlikely
// given that the original shape was not rejected...
- if (mf->directFilterRRectMaskGPU(fContext.get(), fRenderTargetContext.get(),
+ if (mf->directFilterRRectMaskGPU(this->context(), fRenderTargetContext.get(),
std::move(grPaint), this->clip(), this->ctm(),
style.strokeRec(), rrect, devRRect)) {
return;
@@ -1272,7 +1271,7 @@ void SkGpuDevice::drawBitmapRect(const SkBitmap& bitmap,
sk_sp<SkSpecialImage> SkGpuDevice::makeSpecial(const SkBitmap& bitmap) {
// TODO: this makes a tight copy of 'bitmap' but it doesn't have to be (given SkSpecialImage's
// semantics). Since this is cached we would have to bake the fit into the cache key though.
- sk_sp<GrTextureProxy> proxy = GrMakeCachedBitmapProxy(fContext.get(), bitmap);
+ sk_sp<GrTextureProxy> proxy = GrMakeCachedBitmapProxy(fContext->resourceProvider(), bitmap);
if (!proxy) {
return nullptr;
}
@@ -1547,10 +1546,10 @@ void SkGpuDevice::drawBitmapLattice(const SkBitmap& bitmap,
this->drawProducerLattice(&maker, lattice, dst, paint);
}
-bool init_vertices_paint(const SkPaint& skPaint, const SkMatrix& matrix, SkBlendMode bmode,
- bool hasTexs, bool hasColors, GrRenderTargetContext* rtc,
- GrPaint* grPaint) {
- GrContext* context = rtc->surfPriv().getContext();
+static bool init_vertices_paint(GrContext* context, GrRenderTargetContext* rtc,
+ const SkPaint& skPaint,
+ const SkMatrix& matrix, SkBlendMode bmode,
+ bool hasTexs, bool hasColors, GrPaint* grPaint) {
if (hasTexs && skPaint.getShader()) {
if (hasColors) {
// When there are texs and colors the shader and colors are combined using bmode.
@@ -1643,8 +1642,9 @@ void SkGpuDevice::drawVertices(SkCanvas::VertexMode vmode,
GrPrimitiveType primType = SkVertexModeToGrPrimitiveType(vmode);
GrPaint grPaint;
- if (!init_vertices_paint(paint, this->ctm(), bmode, SkToBool(texs), SkToBool(colors),
- fRenderTargetContext.get(), &grPaint)) {
+ if (!init_vertices_paint(fContext.get(), fRenderTargetContext.get(),
+ paint, this->ctm(), bmode, SkToBool(texs),
+ SkToBool(colors), &grPaint)) {
return;
}
fRenderTargetContext->drawVertices(this->clip(),
@@ -1676,8 +1676,8 @@ void SkGpuDevice::drawVerticesObject(sk_sp<SkVertices> vertices,
nullptr, nullptr, mode, vertices->indices(), vertices->indexCount(),
paint);
}
- if (!init_vertices_paint(paint, this->ctm(), mode, hasTexs, hasColors,
- fRenderTargetContext.get(), &grPaint)) {
+ if (!init_vertices_paint(fContext.get(), fRenderTargetContext.get(), paint, this->ctm(),
+ mode, hasTexs, hasColors, &grPaint)) {
return;
}
fRenderTargetContext->drawVertices(this->clip(), std::move(grPaint), this->ctm(),