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

Side by Side Diff: src/gpu/GrDrawTarget.h

Issue 631183003: Revert of gl programs rewrite (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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/gpu/GrDrawState.cpp ('k') | src/gpu/gl/GrGpuGL_program.cpp » ('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 2010 Google Inc. 2 * Copyright 2010 Google Inc.
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 #ifndef GrDrawTarget_DEFINED 8 #ifndef GrDrawTarget_DEFINED
9 #define GrDrawTarget_DEFINED 9 #define GrDrawTarget_DEFINED
10 10
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 int fInstanceCount; 848 int fInstanceCount;
849 int fVerticesPerInstance; 849 int fVerticesPerInstance;
850 int fIndicesPerInstance; 850 int fIndicesPerInstance;
851 851
852 SkRect fDevBoundsStorage; 852 SkRect fDevBoundsStorage;
853 SkRect* fDevBounds; 853 SkRect* fDevBounds;
854 854
855 GrDeviceCoordTexture fDstCopy; 855 GrDeviceCoordTexture fDstCopy;
856 }; 856 };
857 857
858 // Makes a copy of the dst if it is necessary for the draw. Returns false if a copy is required
859 // but couldn't be made. Otherwise, returns true. This method needs to be p rotected because it
860 // needs to be accessed by GLPrograms to setup a correct drawstate
861 bool setupDstReadIfNecessary(DrawInfo* info) {
862 return this->setupDstReadIfNecessary(&info->fDstCopy, info->getDevBounds ());
863 }
864 bool setupDstReadIfNecessary(GrDeviceCoordTexture* dstCopy, const SkRect* dr awBounds);
865
866 private: 858 private:
867 // A subclass can optionally overload this function to be notified before 859 // A subclass can optionally overload this function to be notified before
868 // vertex and index space is reserved. 860 // vertex and index space is reserved.
869 virtual void willReserveVertexAndIndexSpace(int vertexCount, int indexCount) {} 861 virtual void willReserveVertexAndIndexSpace(int vertexCount, int indexCount) {}
870 862
871 // implemented by subclass to allocate space for reserved geom 863 // implemented by subclass to allocate space for reserved geom
872 virtual bool onReserveVertexSpace(size_t vertexSize, int vertexCount, void** vertices) = 0; 864 virtual bool onReserveVertexSpace(size_t vertexSize, int vertexCount, void** vertices) = 0;
873 virtual bool onReserveIndexSpace(int indexCount, void** indices) = 0; 865 virtual bool onReserveIndexSpace(int indexCount, void** indices) = 0;
874 // implemented by subclass to handle release of reserved geom space 866 // implemented by subclass to handle release of reserved geom space
875 virtual void releaseReservedVertexSpace() = 0; 867 virtual void releaseReservedVertexSpace() = 0;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 906
915 // called by drawIndexed and drawNonIndexed. Use a negative indexCount to 907 // called by drawIndexed and drawNonIndexed. Use a negative indexCount to
916 // indicate non-indexed drawing. 908 // indicate non-indexed drawing.
917 bool checkDraw(GrPrimitiveType type, int startVertex, 909 bool checkDraw(GrPrimitiveType type, int startVertex,
918 int startIndex, int vertexCount, 910 int startIndex, int vertexCount,
919 int indexCount) const; 911 int indexCount) const;
920 // called when setting a new vert/idx source to unref prev vb/ib 912 // called when setting a new vert/idx source to unref prev vb/ib
921 void releasePreviousVertexSource(); 913 void releasePreviousVertexSource();
922 void releasePreviousIndexSource(); 914 void releasePreviousIndexSource();
923 915
916 // Makes a copy of the dst if it is necessary for the draw. Returns false if a copy is required
917 // but couldn't be made. Otherwise, returns true.
918 bool setupDstReadIfNecessary(DrawInfo* info) {
919 return this->setupDstReadIfNecessary(&info->fDstCopy, info->getDevBounds ());
920 }
921 bool setupDstReadIfNecessary(GrDeviceCoordTexture* dstCopy, const SkRect* dr awBounds);
922
924 // Check to see if this set of draw commands has been sent out 923 // Check to see if this set of draw commands has been sent out
925 virtual bool isIssued(uint32_t drawID) { return true; } 924 virtual bool isIssued(uint32_t drawID) { return true; }
926 925
927 enum { 926 enum {
928 kPreallocGeoSrcStateStackCnt = 4, 927 kPreallocGeoSrcStateStackCnt = 4,
929 }; 928 };
930 SkSTArray<kPreallocGeoSrcStateStackCnt, GeometrySrcState, true> fGeoSrcState Stack; 929 SkSTArray<kPreallocGeoSrcStateStackCnt, GeometrySrcState, true> fGeoSrcState Stack;
931 const GrClipData* fClip; 930 const GrClipData* fClip;
932 GrDrawState* fDrawState; 931 GrDrawState* fDrawState;
933 GrDrawState fDefaultDraw State; 932 GrDrawState fDefaultDraw State;
934 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar get. 933 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar get.
935 GrContext* fContext; 934 GrContext* fContext;
936 // To keep track that we always have at least as many debug marker adds as r emoves 935 // To keep track that we always have at least as many debug marker adds as r emoves
937 int fGpuTraceMar kerCount; 936 int fGpuTraceMar kerCount;
938 GrTraceMarkerSet fActiveTrace Markers; 937 GrTraceMarkerSet fActiveTrace Markers;
939 GrTraceMarkerSet fStoredTrace Markers; 938 GrTraceMarkerSet fStoredTrace Markers;
940 939
941 typedef SkRefCnt INHERITED; 940 typedef SkRefCnt INHERITED;
942 }; 941 };
943 942
944 #endif 943 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawState.cpp ('k') | src/gpu/gl/GrGpuGL_program.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698