diff options
author | 2017-08-17 15:58:06 -0400 | |
---|---|---|
committer | 2017-08-18 12:47:28 +0000 | |
commit | 3fd295550f8c4fecd4bc61ce916738d49310eb67 (patch) | |
tree | 551160c13d73e996e8f624f21d6f9ba94ca711dd /src/gpu/ops/GrTextureOp.h | |
parent | cc4221be586a00d5190e765ebdb6c5e5731eefa9 (diff) |
Add GrTextureOp and use to implement SkGpuDevice::drawImage[Rect]() when possible
This op draws a texture rectangle in src over blending with no edge antialiasing. It less powerful than NonAAFillRectOp/GrPaint but has less CPU overhead.
Change-Id: Ia6107bb67c1c2a83de14c665aff64b0de2750fba
Reviewed-on: https://skia-review.googlesource.com/33802
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/ops/GrTextureOp.h')
-rw-r--r-- | src/gpu/ops/GrTextureOp.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gpu/ops/GrTextureOp.h b/src/gpu/ops/GrTextureOp.h new file mode 100644 index 0000000000..cf6a227769 --- /dev/null +++ b/src/gpu/ops/GrTextureOp.h @@ -0,0 +1,28 @@ +/* + * Copyright 2017 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "GrColor.h" +#include "GrColorSpaceXform.h" +#include "GrSamplerParams.h" + +class GrDrawOp; +class GrTextureProxy; +struct SkRect; +class SkMatrix; + +namespace GrTextureOp { +/** + * Creates an op that draws a sub-rectangle of a texture. The passed color is modulated by the + * texture's color. 'srcRect' specifies the rectangle of the texture to draw. 'dstRect' specifies + * the rectangle to draw in local coords which will be transformed by 'viewMatrix' to be in device + * space. 'viewMatrix' must be affine. + */ +std::unique_ptr<GrDrawOp> Make(sk_sp<GrTextureProxy>, GrSamplerParams::FilterMode, GrColor, + const SkRect& srcRect, const SkRect& dstRect, + const SkMatrix& viewMatrix, sk_sp<GrColorSpaceXform>, + bool allowSRGBInputs); +} |