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

Side by Side Diff: cc/output/gl_renderer_unittest.cc

Issue 2659023003: [cc] Add SkBlendMode::kDstIn support to cc::Layer (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/output/gl_renderer.h" 5 #include "cc/output/gl_renderer.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 do { \ 77 do { \
78 EXPECT_TRUE((program_binding)->program()); \ 78 EXPECT_TRUE((program_binding)->program()); \
79 EXPECT_TRUE((program_binding)->initialized()); \ 79 EXPECT_TRUE((program_binding)->initialized()); \
80 } while (false) 80 } while (false)
81 81
82 static inline SkBlendMode BlendModeToSkXfermode(BlendMode blend_mode) { 82 static inline SkBlendMode BlendModeToSkXfermode(BlendMode blend_mode) {
83 switch (blend_mode) { 83 switch (blend_mode) {
84 case BLEND_MODE_NONE: 84 case BLEND_MODE_NONE:
85 case BLEND_MODE_NORMAL: 85 case BLEND_MODE_NORMAL:
86 return SkBlendMode::kSrcOver; 86 return SkBlendMode::kSrcOver;
87 case BLEND_MODE_DESTINATION_IN:
88 return SkBlendMode::kDstIn;
87 case BLEND_MODE_SCREEN: 89 case BLEND_MODE_SCREEN:
88 return SkBlendMode::kScreen; 90 return SkBlendMode::kScreen;
89 case BLEND_MODE_OVERLAY: 91 case BLEND_MODE_OVERLAY:
90 return SkBlendMode::kOverlay; 92 return SkBlendMode::kOverlay;
91 case BLEND_MODE_DARKEN: 93 case BLEND_MODE_DARKEN:
92 return SkBlendMode::kDarken; 94 return SkBlendMode::kDarken;
93 case BLEND_MODE_LIGHTEN: 95 case BLEND_MODE_LIGHTEN:
94 return SkBlendMode::kLighten; 96 return SkBlendMode::kLighten;
95 case BLEND_MODE_COLOR_DODGE: 97 case BLEND_MODE_COLOR_DODGE:
96 return SkBlendMode::kColorDodge; 98 return SkBlendMode::kColorDodge;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 231
230 namespace { 232 namespace {
231 233
232 #if !defined(OS_ANDROID) && !defined(OS_WIN) 234 #if !defined(OS_ANDROID) && !defined(OS_WIN)
233 static const TexCoordPrecision kPrecisionList[] = {TEX_COORD_PRECISION_MEDIUM, 235 static const TexCoordPrecision kPrecisionList[] = {TEX_COORD_PRECISION_MEDIUM,
234 TEX_COORD_PRECISION_HIGH}; 236 TEX_COORD_PRECISION_HIGH};
235 237
236 static const BlendMode kBlendModeList[LAST_BLEND_MODE + 1] = { 238 static const BlendMode kBlendModeList[LAST_BLEND_MODE + 1] = {
237 BLEND_MODE_NONE, 239 BLEND_MODE_NONE,
238 BLEND_MODE_NORMAL, 240 BLEND_MODE_NORMAL,
241 BLEND_MODE_DESTINATION_IN,
239 BLEND_MODE_SCREEN, 242 BLEND_MODE_SCREEN,
240 BLEND_MODE_OVERLAY, 243 BLEND_MODE_OVERLAY,
241 BLEND_MODE_DARKEN, 244 BLEND_MODE_DARKEN,
242 BLEND_MODE_LIGHTEN, 245 BLEND_MODE_LIGHTEN,
243 BLEND_MODE_COLOR_DODGE, 246 BLEND_MODE_COLOR_DODGE,
244 BLEND_MODE_COLOR_BURN, 247 BLEND_MODE_COLOR_BURN,
245 BLEND_MODE_HARD_LIGHT, 248 BLEND_MODE_HARD_LIGHT,
246 BLEND_MODE_SOFT_LIGHT, 249 BLEND_MODE_SOFT_LIGHT,
247 BLEND_MODE_DIFFERENCE, 250 BLEND_MODE_DIFFERENCE,
248 BLEND_MODE_EXCLUSION, 251 BLEND_MODE_EXCLUSION,
(...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after
1981 renderer_->SetVisible(true); 1984 renderer_->SetVisible(true);
1982 Mock::VerifyAndClearExpectations(context_support_ptr_); 1985 Mock::VerifyAndClearExpectations(context_support_ptr_);
1983 1986
1984 EXPECT_CALL(*context_support_ptr_, SetAggressivelyFreeResources(true)); 1987 EXPECT_CALL(*context_support_ptr_, SetAggressivelyFreeResources(true));
1985 renderer_->SetVisible(false); 1988 renderer_->SetVisible(false);
1986 Mock::VerifyAndClearExpectations(context_support_ptr_); 1989 Mock::VerifyAndClearExpectations(context_support_ptr_);
1987 } 1990 }
1988 1991
1989 } // namespace 1992 } // namespace
1990 } // namespace cc 1993 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698