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

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

Issue 1717393002: Add "sample locations" feature to GrProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_getmultisamp
Patch Set: vk stubs Created 4 years, 9 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 | « include/private/SkTArray.h ('k') | src/gpu/GrGpu.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 2011 Google Inc. 2 * Copyright 2011 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 GrGpu_DEFINED 8 #ifndef GrGpu_DEFINED
9 #define GrGpu_DEFINED 9 #define GrGpu_DEFINED
10 10
11 #include "GrPipelineBuilder.h" 11 #include "GrPipelineBuilder.h"
12 #include "GrProgramDesc.h" 12 #include "GrProgramDesc.h"
13 #include "GrStencil.h" 13 #include "GrStencil.h"
14 #include "GrSwizzle.h" 14 #include "GrSwizzle.h"
15 #include "GrAllocator.h"
15 #include "GrTextureParamsAdjuster.h" 16 #include "GrTextureParamsAdjuster.h"
16 #include "GrTypes.h" 17 #include "GrTypes.h"
17 #include "GrXferProcessor.h" 18 #include "GrXferProcessor.h"
18 #include "SkPath.h" 19 #include "SkPath.h"
19 #include "SkTArray.h" 20 #include "SkTArray.h"
20 21
21 class GrBatchTracker; 22 class GrBatchTracker;
22 class GrContext; 23 class GrContext;
23 class GrGLContext; 24 class GrGLContext;
24 class GrIndexBuffer; 25 class GrIndexBuffer;
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 359
359 // Called to perform a surface to surface copy. Fallbacks to issuing a draw from the src to dst 360 // Called to perform a surface to surface copy. Fallbacks to issuing a draw from the src to dst
360 // take place at the GrDrawTarget level and this function implement faster c opy paths. The rect 361 // take place at the GrDrawTarget level and this function implement faster c opy paths. The rect
361 // and point are pre-clipped. The src rect and implied dst rect are guarante ed to be within the 362 // and point are pre-clipped. The src rect and implied dst rect are guarante ed to be within the
362 // src/dst bounds and non-empty. 363 // src/dst bounds and non-empty.
363 bool copySurface(GrSurface* dst, 364 bool copySurface(GrSurface* dst,
364 GrSurface* src, 365 GrSurface* src,
365 const SkIRect& srcRect, 366 const SkIRect& srcRect,
366 const SkIPoint& dstPoint); 367 const SkIPoint& dstPoint);
367 368
369 struct MultisampleSpecs {
370 // Nonzero ID that uniquely identifies these multisample specs.
371 uint8_t fUniqueID;
372 // The actual number of samples the GPU will run. NOTE: this value can b e greater than the
373 // the render target's sample count.
374 int fEffectiveSampleCnt;
375 // If sample locations are supported, contains the subpixel locations at which the GPU will
376 // sample. Pixel center is at (.5, .5) and (0, 0) indicates the top left corner.
377 SkAutoTDeleteArray<const SkPoint> fSampleLocations;
378 };
379
380 // Finds a render target's multisample specs. The stencil settings are only needed to flush the
381 // draw state prior to querying multisample information; they should not hav e any effect on the
382 // multisample information itself.
383 const MultisampleSpecs& getMultisampleSpecs(GrRenderTarget*, const GrStencil Settings&);
384
368 struct DrawArgs { 385 struct DrawArgs {
369 DrawArgs(const GrPrimitiveProcessor* primProc, 386 DrawArgs(const GrPrimitiveProcessor* primProc,
370 const GrPipeline* pipeline, 387 const GrPipeline* pipeline,
371 const GrProgramDesc* desc) 388 const GrProgramDesc* desc)
372 : fPrimitiveProcessor(primProc) 389 : fPrimitiveProcessor(primProc)
373 , fPipeline(pipeline) 390 , fPipeline(pipeline)
374 , fDesc(desc) { 391 , fDesc(desc) {
375 SkASSERT(primProc && pipeline && desc); 392 SkASSERT(primProc && pipeline && desc);
376 } 393 }
377 const GrPrimitiveProcessor* fPrimitiveProcessor; 394 const GrPrimitiveProcessor* fPrimitiveProcessor;
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 611
595 // overridden by backend-specific derived class to perform the resolve 612 // overridden by backend-specific derived class to perform the resolve
596 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0; 613 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0;
597 614
598 // overridden by backend specific derived class to perform the copy surface 615 // overridden by backend specific derived class to perform the copy surface
599 virtual bool onCopySurface(GrSurface* dst, 616 virtual bool onCopySurface(GrSurface* dst,
600 GrSurface* src, 617 GrSurface* src,
601 const SkIRect& srcRect, 618 const SkIRect& srcRect,
602 const SkIPoint& dstPoint) = 0; 619 const SkIPoint& dstPoint) = 0;
603 620
621 // overridden by backend specific derived class to perform the multisample q ueries
622 virtual void onGetMultisampleSpecs(GrRenderTarget*,
623 const GrStencilSettings&,
624 int* effectiveSampleCnt,
625 SkAutoTDeleteArray<SkPoint>* sampleLocati ons) = 0;
626
604 void resetContext() { 627 void resetContext() {
605 this->onResetContext(fResetBits); 628 this->onResetContext(fResetBits);
606 fResetBits = 0; 629 fResetBits = 0;
607 ++fResetTimestamp; 630 ++fResetTimestamp;
608 } 631 }
609 632
610 ResetTimestamp fResetTi mestamp; 633 ResetTimestamp fResetTi mestamp;
611 uint32_t fResetBi ts; 634 uint32_t fResetBi ts;
635 SkTArray<const MultisampleSpecs*, true> fMultisa mpleSpecsMap;
636 GrTAllocator<MultisampleSpecs> fMultisa mpleSpecsAllocator;
612 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. 637 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu.
613 GrContext* fContext ; 638 GrContext* fContext ;
614 639
615 friend class GrPathRendering; 640 friend class GrPathRendering;
616 typedef SkRefCnt INHERITED; 641 typedef SkRefCnt INHERITED;
617 }; 642 };
618 643
619 #endif 644 #endif
OLDNEW
« no previous file with comments | « include/private/SkTArray.h ('k') | src/gpu/GrGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698