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

Side by Side Diff: skia/sgl/SkBitmapShader.h

Issue 113827: Remove the remainder of the skia source code from the Chromium repo.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « skia/sgl/SkBitmapSamplerTemplate.h ('k') | skia/sgl/SkBitmapShader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* libs/graphics/sgl/SkBitmapShader.h
2 **
3 ** Copyright 2006, The Android Open Source Project
4 **
5 ** Licensed under the Apache License, Version 2.0 (the "License");
6 ** you may not use this file except in compliance with the License.
7 ** You may obtain a copy of the License at
8 **
9 ** http://www.apache.org/licenses/LICENSE-2.0
10 **
11 ** Unless required by applicable law or agreed to in writing, software
12 ** distributed under the License is distributed on an "AS IS" BASIS,
13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ** See the License for the specific language governing permissions and
15 ** limitations under the License.
16 */
17
18 #ifndef SkBitmapShader_DEFINED
19 #define SkBitmapShader_DEFINED
20
21 #include "SkShader.h"
22 #include "SkBitmap.h"
23 #include "SkPaint.h"
24
25 class SkBitmapShader : public SkShader {
26 public:
27 SkBitmapShader( const SkBitmap& src,
28 bool doFilter, TileMode tx, TileMode ty);
29
30 virtual bool setContext(const SkBitmap&, const SkPaint& paint, const SkMatrix&);
31 virtual uint32_t getFlags() { return fFlags; }
32
33 protected:
34 SkBitmapShader(SkFlattenableReadBuffer& );
35 virtual void flatten(SkFlattenableWriteBuffer& );
36 virtual Factory getFactory() { return CreateProc; }
37 const SkBitmap& getSrcBitmap() const
38 {
39 #ifdef SK_SUPPORT_MIPMAP
40 return fMipSrcBitmap;
41 #else
42 return fOrigSrcBitmap;
43 #endif
44 }
45 bool getFilterBitmap() const { return fFilterBitmap != 0; }
46 TileMode getTileModeX() const { return (TileMode)fTileModeX; }
47 TileMode getTileModeY() const { return (TileMode)fTileModeY; }
48 SkFixed getMipLevel() const
49 {
50 #ifdef SK_SUPPORT_MIPMAP
51 return fMipLevel;
52 #else
53 return 0;
54 #endif
55 }
56
57 private:
58 static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) {
59 return SkNEW_ARGS(SkBitmapShader, (buffer)); }
60 #ifdef SK_SUPPORT_MIPMAP
61 SkFixed fMipLevel;
62 SkBitmap fMipSrcBitmap; // the chosen level (in setContext)
63 #endif
64 SkBitmap fOrigSrcBitmap;
65 uint8_t fFilterBitmap;
66 uint8_t fTileModeX;
67 uint8_t fTileModeY;
68 uint8_t fFlags;
69
70 typedef SkShader INHERITED;
71 };
72
73 #endif
OLDNEW
« no previous file with comments | « skia/sgl/SkBitmapSamplerTemplate.h ('k') | skia/sgl/SkBitmapShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698