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

Side by Side Diff: gm/yuvtorgbeffect.cpp

Issue 1037793002: C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: git cl web Created 5 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 | « gm/xfermodes3.cpp ('k') | gyp/common_conditions.gypi » ('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 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 // This test only works with the GPU backend. 9 // This test only works with the GPU backend.
10 10
(...skipping 16 matching lines...) Expand all
27 /** 27 /**
28 * This GM directly exercises GrYUVtoRGBEffect. 28 * This GM directly exercises GrYUVtoRGBEffect.
29 */ 29 */
30 class YUVtoRGBEffect : public GM { 30 class YUVtoRGBEffect : public GM {
31 public: 31 public:
32 YUVtoRGBEffect() { 32 YUVtoRGBEffect() {
33 this->setBGColor(0xFFFFFFFF); 33 this->setBGColor(0xFFFFFFFF);
34 } 34 }
35 35
36 protected: 36 protected:
37 SkString onShortName() SK_OVERRIDE { 37 SkString onShortName() override {
38 return SkString("yuv_to_rgb_effect"); 38 return SkString("yuv_to_rgb_effect");
39 } 39 }
40 40
41 SkISize onISize() SK_OVERRIDE { 41 SkISize onISize() override {
42 return SkISize::Make(238, 84); 42 return SkISize::Make(238, 84);
43 } 43 }
44 44
45 void onOnceBeforeDraw() SK_OVERRIDE { 45 void onOnceBeforeDraw() override {
46 SkImageInfo yinfo = SkImageInfo::MakeA8(YSIZE, YSIZE); 46 SkImageInfo yinfo = SkImageInfo::MakeA8(YSIZE, YSIZE);
47 fBmp[0].allocPixels(yinfo); 47 fBmp[0].allocPixels(yinfo);
48 SkImageInfo uinfo = SkImageInfo::MakeA8(USIZE, USIZE); 48 SkImageInfo uinfo = SkImageInfo::MakeA8(USIZE, USIZE);
49 fBmp[1].allocPixels(uinfo); 49 fBmp[1].allocPixels(uinfo);
50 SkImageInfo vinfo = SkImageInfo::MakeA8(VSIZE, VSIZE); 50 SkImageInfo vinfo = SkImageInfo::MakeA8(VSIZE, VSIZE);
51 fBmp[2].allocPixels(vinfo); 51 fBmp[2].allocPixels(vinfo);
52 unsigned char* pixels[3]; 52 unsigned char* pixels[3];
53 for (int i = 0; i < 3; ++i) { 53 for (int i = 0; i < 3; ++i) {
54 pixels[i] = (unsigned char*)fBmp[i].getPixels(); 54 pixels[i] = (unsigned char*)fBmp[i].getPixels();
55 } 55 }
56 int color[] = {0, 85, 170}; 56 int color[] = {0, 85, 170};
57 const int limit[] = {255, 0, 255}; 57 const int limit[] = {255, 0, 255};
58 const int invl[] = {0, 255, 0}; 58 const int invl[] = {0, 255, 0};
59 const int inc[] = {1, -1, 1}; 59 const int inc[] = {1, -1, 1};
60 for (int i = 0; i < 3; ++i) { 60 for (int i = 0; i < 3; ++i) {
61 const size_t nbBytes = fBmp[i].rowBytes() * fBmp[i].height(); 61 const size_t nbBytes = fBmp[i].rowBytes() * fBmp[i].height();
62 for (size_t j = 0; j < nbBytes; ++j) { 62 for (size_t j = 0; j < nbBytes; ++j) {
63 pixels[i][j] = (unsigned char)color[i]; 63 pixels[i][j] = (unsigned char)color[i];
64 color[i] = (color[i] == limit[i]) ? invl[i] : color[i] + inc[i]; 64 color[i] = (color[i] == limit[i]) ? invl[i] : color[i] + inc[i];
65 } 65 }
66 } 66 }
67 } 67 }
68 68
69 void onDraw(SkCanvas* canvas) SK_OVERRIDE { 69 void onDraw(SkCanvas* canvas) override {
70 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget (); 70 GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget ();
71 if (NULL == rt) { 71 if (NULL == rt) {
72 return; 72 return;
73 } 73 }
74 GrContext* context = rt->getContext(); 74 GrContext* context = rt->getContext();
75 if (NULL == context) { 75 if (NULL == context) {
76 this->drawGpuOnlyMessage(canvas); 76 this->drawGpuOnlyMessage(canvas);
77 return; 77 return;
78 } 78 }
79 79
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 private: 136 private:
137 SkBitmap fBmp[3]; 137 SkBitmap fBmp[3];
138 138
139 typedef GM INHERITED; 139 typedef GM INHERITED;
140 }; 140 };
141 141
142 DEF_GM( return SkNEW(YUVtoRGBEffect); ) 142 DEF_GM( return SkNEW(YUVtoRGBEffect); )
143 } 143 }
144 144
145 #endif 145 #endif
OLDNEW
« no previous file with comments | « gm/xfermodes3.cpp ('k') | gyp/common_conditions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698