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

Side by Side Diff: src/effects/SkXfermodeImageFilter.cpp

Issue 1151283004: Split drawing functionality out of GrContext and into new GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix no-GPU builds Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/gpu/GrAARectRenderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 The Android Open Source Project 2 * Copyright 2013 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkXfermodeImageFilter.h" 8 #include "SkXfermodeImageFilter.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkDevice.h" 10 #include "SkDevice.h"
11 #include "SkColorPriv.h" 11 #include "SkColorPriv.h"
12 #include "SkReadBuffer.h" 12 #include "SkReadBuffer.h"
13 #include "SkWriteBuffer.h" 13 #include "SkWriteBuffer.h"
14 #include "SkXfermode.h" 14 #include "SkXfermode.h"
15 #if SK_SUPPORT_GPU 15 #if SK_SUPPORT_GPU
16 #include "GrContext.h" 16 #include "GrContext.h"
17 #include "GrDrawContext.h"
17 #include "effects/GrTextureDomain.h" 18 #include "effects/GrTextureDomain.h"
18 #include "SkGr.h" 19 #include "SkGr.h"
19 #endif 20 #endif
20 21
21 /////////////////////////////////////////////////////////////////////////////// 22 ///////////////////////////////////////////////////////////////////////////////
22 23
23 SkXfermodeImageFilter::SkXfermodeImageFilter(SkXfermode* mode, 24 SkXfermodeImageFilter::SkXfermodeImageFilter(SkXfermode* mode,
24 SkImageFilter* inputs[2], 25 SkImageFilter* inputs[2],
25 const CropRect* cropRect) 26 const CropRect* cropRect)
26 : INHERITED(2, inputs, cropRect), fMode(mode) { 27 : INHERITED(2, inputs, cropRect), fMode(mode) {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 GrPaint paint; 172 GrPaint paint;
172 SkAutoTUnref<GrFragmentProcessor> foregroundDomain(GrTextureDomainEffect::Cr eate( 173 SkAutoTUnref<GrFragmentProcessor> foregroundDomain(GrTextureDomainEffect::Cr eate(
173 foregroundTex, foregroundMatrix, 174 foregroundTex, foregroundMatrix,
174 GrTextureDomain::MakeTexelDomain(foregroundTex, foreground.bounds()), 175 GrTextureDomain::MakeTexelDomain(foregroundTex, foreground.bounds()),
175 GrTextureDomain::kDecal_Mode, 176 GrTextureDomain::kDecal_Mode,
176 GrTextureParams::kNone_FilterMode) 177 GrTextureParams::kNone_FilterMode)
177 ); 178 );
178 179
179 paint.addColorProcessor(foregroundDomain.get()); 180 paint.addColorProcessor(foregroundDomain.get());
180 paint.addColorProcessor(xferProcessor)->unref(); 181 paint.addColorProcessor(xferProcessor)->unref();
181 context->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), paint, SkMatrix ::I(), srcRect); 182
183 GrDrawContext* drawContext = context->drawContext();
184 if (!drawContext) {
185 return false;
186 }
187
188 drawContext->drawRect(dst->asRenderTarget(), GrClip::WideOpen(), paint,
189 SkMatrix::I(), srcRect);
182 190
183 offset->fX = backgroundOffset.fX; 191 offset->fX = backgroundOffset.fX;
184 offset->fY = backgroundOffset.fY; 192 offset->fY = backgroundOffset.fY;
185 WrapTexture(dst, src.width(), src.height(), result); 193 WrapTexture(dst, src.width(), src.height(), result);
186 return true; 194 return true;
187 } 195 }
188 196
189 #endif 197 #endif
190 198
OLDNEW
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/gpu/GrAARectRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698