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

Side by Side Diff: cc/trees/layer_tree_host_pixeltest_blending.cc

Issue 2873593002: Force use of and cache render surface. (Closed)
Patch Set: Calculate damage of |force_render_surface|. Created 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "cc/layers/picture_image_layer.h" 7 #include "cc/layers/picture_image_layer.h"
8 #include "cc/layers/solid_color_layer.h" 8 #include "cc/layers/solid_color_layer.h"
9 #include "cc/paint/paint_image.h" 9 #include "cc/paint/paint_image.h"
10 #include "cc/test/layer_tree_pixel_resource_test.h" 10 #include "cc/test/layer_tree_pixel_resource_test.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 opacity = 0.5f; 215 opacity = 0.5f;
216 } else if (i == kBlendModesCount + 5) { 216 } else if (i == kBlendModesCount + 5) {
217 blend_mode = SkBlendMode::kDstIn; 217 blend_mode = SkBlendMode::kDstIn;
218 color = kMiscTransparentColor; 218 color = kMiscTransparentColor;
219 } 219 }
220 220
221 scoped_refptr<SolidColorLayer> lane = 221 scoped_refptr<SolidColorLayer> lane =
222 CreateSolidColorLayer(child_rect, color); 222 CreateSolidColorLayer(child_rect, color);
223 lane->SetBlendMode(blend_mode); 223 lane->SetBlendMode(blend_mode);
224 lane->SetOpacity(opacity); 224 lane->SetOpacity(opacity);
225 lane->SetForceRenderSurfaceForTesting(true); 225 lane->SetForceRenderSurface(true);
226 // Layers with kDstIn blend mode with a mask is not supported. 226 // Layers with kDstIn blend mode with a mask is not supported.
227 if (flags & kUseMasks && blend_mode != SkBlendMode::kDstIn) 227 if (flags & kUseMasks && blend_mode != SkBlendMode::kDstIn)
228 SetupMaskLayer(lane); 228 SetupMaskLayer(lane);
229 if (flags & kUseColorMatrix) { 229 if (flags & kUseColorMatrix) {
230 SetupColorMatrix(lane); 230 SetupColorMatrix(lane);
231 } 231 }
232 background->AddChild(lane); 232 background->AddChild(lane);
233 } 233 }
234 } 234 }
235 235
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 RunBlendingWithRenderPass( 503 RunBlendingWithRenderPass(
504 GL_ZERO_COPY_RECT_DRAW, 504 GL_ZERO_COPY_RECT_DRAW,
505 FILE_PATH_LITERAL("blending_render_pass_mask.png"), 505 FILE_PATH_LITERAL("blending_render_pass_mask.png"),
506 kUseMasks | kUseAntialiasing | kUseColorMatrix | kForceShaders); 506 kUseMasks | kUseAntialiasing | kUseColorMatrix | kForceShaders);
507 } 507 }
508 508
509 } // namespace 509 } // namespace
510 } // namespace cc 510 } // namespace cc
511 511
512 #endif // OS_ANDROID 512 #endif // OS_ANDROID
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698