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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp

Issue 2878573003: Initial skeleton of high-contrast mode. (Closed)
Patch Set: Don't pass settings to GraphicsLayer, address other feedback from chrishtr Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 client_->ComputeInterestRect(this, previous_interest_rect_); 308 client_->ComputeInterestRect(this, previous_interest_rect_);
309 interest_rect = &new_interest_rect; 309 interest_rect = &new_interest_rect;
310 } 310 }
311 311
312 if (!GetPaintController().SubsequenceCachingIsDisabled() && 312 if (!GetPaintController().SubsequenceCachingIsDisabled() &&
313 !client_->NeedsRepaint(*this) && !GetPaintController().CacheIsEmpty() && 313 !client_->NeedsRepaint(*this) && !GetPaintController().CacheIsEmpty() &&
314 previous_interest_rect_ == *interest_rect) { 314 previous_interest_rect_ == *interest_rect) {
315 return false; 315 return false;
316 } 316 }
317 317
318 GraphicsContext context(GetPaintController(), disabled_mode, nullptr); 318 GraphicsContext context(GetPaintController(), nullptr, disabled_mode,
319 nullptr);
319 320
320 previous_interest_rect_ = *interest_rect; 321 previous_interest_rect_ = *interest_rect;
321 client_->PaintContents(this, context, painting_phase_, *interest_rect); 322 client_->PaintContents(this, context, painting_phase_, *interest_rect);
322 return true; 323 return true;
323 } 324 }
324 325
325 void GraphicsLayer::UpdateChildList() { 326 void GraphicsLayer::UpdateChildList() {
326 WebLayer* child_host = layer_->Layer(); 327 WebLayer* child_host = layer_->Layer();
327 child_host->RemoveAllChildren(); 328 child_host->RemoveAllChildren();
328 329
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
1178 void GraphicsLayer::SetCompositorMutableProperties(uint32_t properties) { 1179 void GraphicsLayer::SetCompositorMutableProperties(uint32_t properties) {
1179 if (WebLayer* layer = PlatformLayer()) 1180 if (WebLayer* layer = PlatformLayer())
1180 layer->SetCompositorMutableProperties(properties); 1181 layer->SetCompositorMutableProperties(properties);
1181 } 1182 }
1182 1183
1183 sk_sp<PaintRecord> GraphicsLayer::CaptureRecord() { 1184 sk_sp<PaintRecord> GraphicsLayer::CaptureRecord() {
1184 if (!DrawsContent()) 1185 if (!DrawsContent())
1185 return nullptr; 1186 return nullptr;
1186 1187
1187 FloatRect bounds(IntRect(IntPoint(0, 0), ExpandedIntSize(Size()))); 1188 FloatRect bounds(IntRect(IntPoint(0, 0), ExpandedIntSize(Size())));
1188 GraphicsContext graphics_context(GetPaintController(), 1189 GraphicsContext graphics_context(GetPaintController(), nullptr,
1189 GraphicsContext::kNothingDisabled, nullptr); 1190 GraphicsContext::kNothingDisabled, nullptr);
1190 graphics_context.BeginRecording(bounds); 1191 graphics_context.BeginRecording(bounds);
1191 GetPaintController().GetPaintArtifact().Replay(bounds, graphics_context); 1192 GetPaintController().GetPaintArtifact().Replay(bounds, graphics_context);
1192 return graphics_context.EndRecording(); 1193 return graphics_context.EndRecording();
1193 } 1194 }
1194 1195
1195 static bool PixelComponentsDiffer(int c1, int c2) { 1196 static bool PixelComponentsDiffer(int c1, int c2) {
1196 // Compare strictly for saturated values. 1197 // Compare strictly for saturated values.
1197 if (c1 == 0 || c1 == 255 || c2 == 0 || c2 == 255) 1198 if (c1 == 0 || c1 == 255 || c2 == 0 || c2 == 255)
1198 return c1 != c2; 1199 return c1 != c2;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { 1293 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) {
1293 if (!layer) { 1294 if (!layer) {
1294 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; 1295 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil).";
1295 return; 1296 return;
1296 } 1297 }
1297 1298
1298 String output = layer->LayerTreeAsText(blink::kLayerTreeIncludesDebugInfo); 1299 String output = layer->LayerTreeAsText(blink::kLayerTreeIncludesDebugInfo);
1299 LOG(INFO) << output.Utf8().data(); 1300 LOG(INFO) << output.Utf8().data();
1300 } 1301 }
1301 #endif 1302 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698