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

Side by Side Diff: samplecode/SampleXfermodesBlur.cpp

Issue 300263005: Revert "Revert of add colortable support to imagegenerator (https://codereview.chromium.org/3044430… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 6 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 | « samplecode/SampleHairline.cpp ('k') | src/core/SkBitmap.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 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkBlurMask.h" 10 #include "SkBlurMask.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 p.setColor(0x00AA6633 | alpha << 24); 68 p.setColor(0x00AA6633 | alpha << 24);
69 r.set(ww/3, hh/3, ww*19/20, hh*19/20); 69 r.set(ww/3, hh/3, ww*19/20, hh*19/20);
70 r.offset(x, y); 70 r.offset(x, y);
71 canvas->drawRect(r, p); 71 canvas->drawRect(r, p);
72 } 72 }
73 73
74 public: 74 public:
75 const static int W = 64; 75 const static int W = 64;
76 const static int H = 64; 76 const static int H = 64;
77 XfermodesBlurView() { 77 XfermodesBlurView() {
78 fBG.installPixels(SkImageInfo::Make(2, 2, kARGB_4444_SkColorType, 78 fBG.installPixels(SkImageInfo::Make(2, 2, kARGB_4444_SkColorType, kPremu l_SkAlphaType),
79 kPremul_SkAlphaType), 79 gBG, 4);
80 gBG, 4, NULL, NULL);
81 } 80 }
82 81
83 protected: 82 protected:
84 // overrides from SkEventSink 83 // overrides from SkEventSink
85 virtual bool onQuery(SkEvent* evt) { 84 virtual bool onQuery(SkEvent* evt) {
86 if (SampleCode::TitleQ(*evt)) { 85 if (SampleCode::TitleQ(*evt)) {
87 SampleCode::TitleR(evt, "XfermodesBlur"); 86 SampleCode::TitleR(evt, "XfermodesBlur");
88 return true; 87 return true;
89 } 88 }
90 return this->INHERITED::onQuery(evt); 89 return this->INHERITED::onQuery(evt);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 } 201 }
203 202
204 private: 203 private:
205 typedef SampleView INHERITED; 204 typedef SampleView INHERITED;
206 }; 205 };
207 206
208 ////////////////////////////////////////////////////////////////////////////// 207 //////////////////////////////////////////////////////////////////////////////
209 208
210 static SkView* MyFactory() { return new XfermodesBlurView; } 209 static SkView* MyFactory() { return new XfermodesBlurView; }
211 static SkViewRegister reg(MyFactory); 210 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleHairline.cpp ('k') | src/core/SkBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698