• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2017 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 #ifndef GrMockStencilAttachment_DEFINED
9 #define GrMockStencilAttachment_DEFINED
10 
11 #include "GrMockGpu.h"
12 #include "GrStencilAttachment.h"
13 
14 class GrMockStencilAttachment : public GrStencilAttachment {
15 public:
GrMockStencilAttachment(GrMockGpu * gpu,int width,int height,int bits,int sampleCnt)16     GrMockStencilAttachment(GrMockGpu* gpu, int width, int height, int bits, int sampleCnt)
17             : INHERITED(gpu, width, height, bits, sampleCnt) {
18         this->registerWithCache(SkBudgeted::kYes);
19     }
20 
21 private:
onGpuMemorySize()22     size_t onGpuMemorySize() const override {
23         return SkTMax(1, (int)(this->bits() / sizeof(char))) * this->width() * this->height();
24     }
25 
26     typedef GrStencilAttachment INHERITED;
27 };
28 
29 #endif
30