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

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

Issue 1062863002: Avoid regenerating cached textblobs on integer scrolls (Closed) Base URL: https://skia.googlesource.com/skia.git@atlastextcache
Patch Set: some sleight bug fixes Created 5 years, 8 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
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
11 #include "GrClip.h" 11 #include "GrClip.h"
12 #include "GrClipMaskManager.h" 12 #include "GrClipMaskManager.h"
13 #include "GrContext.h" 13 #include "GrContext.h"
14 #include "GrMemoryPool.h"
15 #include "GrPathProcessor.h" 14 #include "GrPathProcessor.h"
16 #include "GrPrimitiveProcessor.h" 15 #include "GrPrimitiveProcessor.h"
17 #include "GrIndexBuffer.h" 16 #include "GrIndexBuffer.h"
18 #include "GrPathRendering.h" 17 #include "GrPathRendering.h"
19 #include "GrPipelineBuilder.h" 18 #include "GrPipelineBuilder.h"
20 #include "GrTraceMarker.h" 19 #include "GrTraceMarker.h"
21 #include "GrVertexBuffer.h" 20 #include "GrVertexBuffer.h"
22 21
23 #include "SkClipStack.h" 22 #include "SkClipStack.h"
24 #include "SkMatrix.h" 23 #include "SkMatrix.h"
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 GrPendingIOResource<const GrVertexBuffer, kRead_GrIOType> fVertexBuffer; 566 GrPendingIOResource<const GrVertexBuffer, kRead_GrIOType> fVertexBuffer;
568 GrPendingIOResource<const GrIndexBuffer, kRead_GrIOType> fIndexBuffer; 567 GrPendingIOResource<const GrIndexBuffer, kRead_GrIOType> fIndexBuffer;
569 }; 568 };
570 569
571 /** 570 /**
572 * Used to populate the vertex and index buffer on the draw info before onDr aw is called. 571 * Used to populate the vertex and index buffer on the draw info before onDr aw is called.
573 */ 572 */
574 virtual void setDrawBuffers(DrawInfo*, size_t vertexStride) = 0;; 573 virtual void setDrawBuffers(DrawInfo*, size_t vertexStride) = 0;;
575 bool programUnitTest(int maxStages); 574 bool programUnitTest(int maxStages);
576 575
577 // TODO I should make the bitmapTextBlob cache a thing, which lives on draw target
578 GrMemoryPool* pool() { return &fPool; }
579
580 protected: 576 protected:
581 friend class GrTargetCommands; // for PipelineInfo 577 friend class GrTargetCommands; // for PipelineInfo
582 578
583 enum GeometrySrcType { 579 enum GeometrySrcType {
584 kNone_GeometrySrcType, //<! src has not been specified 580 kNone_GeometrySrcType, //<! src has not been specified
585 kReserved_GeometrySrcType, //<! src was set using reserve*Space 581 kReserved_GeometrySrcType, //<! src was set using reserve*Space
586 kBuffer_GeometrySrcType //<! src was set using set*SourceToBuffer 582 kBuffer_GeometrySrcType //<! src was set using set*SourceToBuffer
587 }; 583 };
588 584
589 struct GeometrySrcState { 585 struct GeometrySrcState {
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 enum { 800 enum {
805 kPreallocGeoSrcStateStackCnt = 4, 801 kPreallocGeoSrcStateStackCnt = 4,
806 }; 802 };
807 SkSTArray<kPreallocGeoSrcStateStackCnt, GeometrySrcState, true> fGeoSrcState Stack; 803 SkSTArray<kPreallocGeoSrcStateStackCnt, GeometrySrcState, true> fGeoSrcState Stack;
808 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar get. 804 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar get.
809 GrContext* fContext; 805 GrContext* fContext;
810 // To keep track that we always have at least as many debug marker adds as r emoves 806 // To keep track that we always have at least as many debug marker adds as r emoves
811 int fGpuTraceMar kerCount; 807 int fGpuTraceMar kerCount;
812 GrTraceMarkerSet fActiveTrace Markers; 808 GrTraceMarkerSet fActiveTrace Markers;
813 GrTraceMarkerSet fStoredTrace Markers; 809 GrTraceMarkerSet fStoredTrace Markers;
814 GrMemoryPool fPool;
815 810
816 typedef SkRefCnt INHERITED; 811 typedef SkRefCnt INHERITED;
817 }; 812 };
818 813
819 /* 814 /*
820 * This class is JUST for clip mask manager. Everyone else should just use draw target above. 815 * This class is JUST for clip mask manager. Everyone else should just use draw target above.
821 */ 816 */
822 class GrClipTarget : public GrDrawTarget { 817 class GrClipTarget : public GrDrawTarget {
823 public: 818 public:
824 GrClipTarget(GrContext* context) : INHERITED(context) { 819 GrClipTarget(GrContext* context) : INHERITED(context) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 virtual bool setupClip(GrPipelineBuilder*, 853 virtual bool setupClip(GrPipelineBuilder*,
859 GrPipelineBuilder::AutoRestoreFragmentProcessors*, 854 GrPipelineBuilder::AutoRestoreFragmentProcessors*,
860 GrPipelineBuilder::AutoRestoreStencil*, 855 GrPipelineBuilder::AutoRestoreStencil*,
861 GrScissorState* scissorState, 856 GrScissorState* scissorState,
862 const SkRect* devBounds) override; 857 const SkRect* devBounds) override;
863 858
864 typedef GrDrawTarget INHERITED; 859 typedef GrDrawTarget INHERITED;
865 }; 860 };
866 861
867 #endif 862 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698