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

Side by Side Diff: ui/compositor/compositor_switches.cc

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Unittest update Created 3 years, 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ui/compositor/compositor_switches.h" 5 #include "ui/compositor/compositor_switches.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 8
9 namespace switches { 9 namespace switches {
10 10
(...skipping 14 matching lines...) Expand all
25 const char kUIDisablePartialSwap[] = "ui-disable-partial-swap"; 25 const char kUIDisablePartialSwap[] = "ui-disable-partial-swap";
26 26
27 const char kUIEnableRGBA4444Textures[] = "ui-enable-rgba-4444-textures"; 27 const char kUIEnableRGBA4444Textures[] = "ui-enable-rgba-4444-textures";
28 28
29 const char kUIEnableZeroCopy[] = "ui-enable-zero-copy"; 29 const char kUIEnableZeroCopy[] = "ui-enable-zero-copy";
30 30
31 const char kUIShowPaintRects[] = "ui-show-paint-rects"; 31 const char kUIShowPaintRects[] = "ui-show-paint-rects";
32 32
33 const char kUISlowAnimations[] = "ui-slow-animations"; 33 const char kUISlowAnimations[] = "ui-slow-animations";
34 34
35 // If enabled, all draw commands recorded on canvas are done in pixel aligned
36 // measurements. This also enables scaling of all elements in views and layers
37 // to be done via corner points. See https://goo.gl/Dqig5s
38 const char kEnablePixelCanvasRecording[] = "enable-pixel-canvas-recording";
39
35 } // namespace switches 40 } // namespace switches
36 41
37 namespace ui { 42 namespace ui {
43 namespace {
44 bool kEnablePixelCanvasForTesting = false;
danakj 2017/07/25 17:58:56 remove
malaykeshav 2017/07/25 22:57:57 Done
45 }
38 46
39 bool IsUIZeroCopyEnabled() { 47 bool IsUIZeroCopyEnabled() {
40 const base::CommandLine& command_line = 48 const base::CommandLine& command_line =
41 *base::CommandLine::ForCurrentProcess(); 49 *base::CommandLine::ForCurrentProcess();
42 return command_line.HasSwitch(switches::kUIEnableZeroCopy); 50 return command_line.HasSwitch(switches::kUIEnableZeroCopy);
43 } 51 }
44 52
53 bool IsPixelCanvasRecordingEnabled() {
54 static const bool kIsPixelCanvasRecordingEnabled =
55 base::CommandLine::ForCurrentProcess()->HasSwitch(
56 switches::kEnablePixelCanvasRecording);
57 return kIsPixelCanvasRecordingEnabled || kEnablePixelCanvasForTesting;
58 }
59
45 } // namespace ui 60 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698