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/gpu/GrXferProcessor.cpp

Issue 885923002: Move DstCopy on gpu into the GrXferProcessor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "GrXferProcessor.h"
9 #include "gl/GrGLCaps.h"
10
11 GrXferProcessor::GrXferProcessor() : fWillReadDstColor(false), fDstCopyTextureOf fset() {
12 }
13
14 GrXferProcessor::GrXferProcessor(const GrDeviceCoordTexture* dstCopy, bool willR eadDstColor)
15 : fWillReadDstColor(willReadDstColor)
16 , fDstCopyTextureOffset() {
17 if (dstCopy && dstCopy->texture()) {
18 fDstCopy.reset(dstCopy->texture());
19 fDstCopyTextureOffset = dstCopy->offset();
20 this->addTextureAccess(&fDstCopy);
bsalomon 2015/02/03 17:28:24 Assert that fDstCopy has kTopLeft origin?
egdaniel 2015/02/03 19:50:57 Done.
21 }
22 }
23
24 void GrXferProcessor::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuil der* b) const {
25 uint32_t key = this->willReadDstColor() ? 0x1 : 0x0;
26 b->add32(key);
27 this->onGetGLProcessorKey(caps, b);
28 }
29
30 ///////////////////////////////////////////////////////////////////////////////
31
32 GrXferProcessor* GrXPFactory::createXferProcessor(const GrProcOptInfo& colorPOI,
33 const GrProcOptInfo& coverageP OI,
34 const GrDeviceCoordTexture* ds tCopy,
35 const GrDrawTargetCaps& caps) const {
36 #ifdef SK_DEBUG
37 if (this->willReadDstColor()) {
38 if (!caps.dstReadInShaderSupport()) {
39 SkASSERT(dstCopy && dstCopy->texture());
40 } else {
41 SkASSERT(!dstCopy || !dstCopy->texture());
42 }
43 } else {
44 SkASSERT(!dstCopy || !dstCopy->texture());
45
46 }
47 #endif
48 return this->onCreateXferProcessor(colorPOI, coveragePOI, dstCopy);
49 }
50
51 bool GrXPFactory::willNeedDstCopy(const GrDrawTargetCaps& caps) const {
52 return (this->willReadDstColor() && !caps.dstReadInShaderSupport());
53 }
54
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698