blob: 1f5133f86d9f1aba4fe9ccfb6e2bcdb71f7d5d5a [file] [log] [blame]
reed@google.comac10a2d2010-12-22 21:39:39 +00001/*
2 Copyright 2010 Google Inc.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 */
16
17
18#ifndef SkGrTexturePixelRef_DEFINED
19#define SkGrTexturePixelRef_DEFINED
20
21#include "SkPixelRef.h"
22#include "GrGpu.h"
23
24class SkGrTexturePixelRef : public SkPixelRef {
25public:
26 SkGrTexturePixelRef(GrTexture*);
27 virtual ~SkGrTexturePixelRef();
28
29 // override from SkPixelRef
30 virtual SkGpuTexture* getTexture() { return (SkGpuTexture*)fTexture; }
31
32protected:
33 // override from SkPixelRef
34 virtual void* onLockPixels(SkColorTable** ptr) {
35 if (ptr) {
36 *ptr = NULL;
37 }
38 return NULL;
39 }
40
41 // override from SkPixelRef
42 virtual void onUnlockPixels() {}
43
44private:
45 GrTexture* fTexture;
46 typedef SkPixelRef INHERITED;
47};
48
49#endif
50