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

Side by Side Diff: ui/aura/bench/bench_main.cc

Issue 1064133003: ui: Use a PaintRecorder to access the Canvas for painting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | ui/aura/demo/demo_main.cc » ('j') | ui/aura/window_unittest.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #if defined(USE_X11) 5 #if defined(USE_X11)
6 #include <X11/Xlib.h> 6 #include <X11/Xlib.h>
7 #endif 7 #endif
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 11 matching lines...) Expand all
22 #include "ui/aura/env.h" 22 #include "ui/aura/env.h"
23 #include "ui/aura/test/test_focus_client.h" 23 #include "ui/aura/test/test_focus_client.h"
24 #include "ui/aura/test/test_screen.h" 24 #include "ui/aura/test/test_screen.h"
25 #include "ui/aura/window.h" 25 #include "ui/aura/window.h"
26 #include "ui/aura/window_tree_host.h" 26 #include "ui/aura/window_tree_host.h"
27 #include "ui/base/hit_test.h" 27 #include "ui/base/hit_test.h"
28 #include "ui/compositor/compositor.h" 28 #include "ui/compositor/compositor.h"
29 #include "ui/compositor/compositor_observer.h" 29 #include "ui/compositor/compositor_observer.h"
30 #include "ui/compositor/debug_utils.h" 30 #include "ui/compositor/debug_utils.h"
31 #include "ui/compositor/layer.h" 31 #include "ui/compositor/layer.h"
32 #include "ui/compositor/paint_context.h" 32 #include "ui/compositor/paint_recorder.h"
33 #include "ui/compositor/test/in_process_context_factory.h" 33 #include "ui/compositor/test/in_process_context_factory.h"
34 #include "ui/gfx/canvas.h" 34 #include "ui/gfx/canvas.h"
35 #include "ui/gfx/geometry/rect.h" 35 #include "ui/gfx/geometry/rect.h"
36 #include "ui/gfx/skia_util.h" 36 #include "ui/gfx/skia_util.h"
37 #include "ui/gfx/x/x11_connection.h" 37 #include "ui/gfx/x/x11_connection.h"
38 #include "ui/gl/gl_surface.h" 38 #include "ui/gl/gl_surface.h"
39 39
40 #ifndef GL_GLEXT_PROTOTYPES 40 #ifndef GL_GLEXT_PROTOTYPES
41 #define GL_GLEXT_PROTOTYPES 1 41 #define GL_GLEXT_PROTOTYPES 1
42 #endif 42 #endif
(...skipping 13 matching lines...) Expand all
56 color_(color), 56 color_(color),
57 draw_(true) { 57 draw_(true) {
58 set_delegate(this); 58 set_delegate(this);
59 } 59 }
60 60
61 ~ColoredLayer() override {} 61 ~ColoredLayer() override {}
62 62
63 // Overridden from LayerDelegate: 63 // Overridden from LayerDelegate:
64 void OnPaintLayer(const ui::PaintContext& context) override { 64 void OnPaintLayer(const ui::PaintContext& context) override {
65 if (draw_) { 65 if (draw_) {
66 context.canvas()->DrawColor(color_); 66 ui::PaintRecorder recorder(context);
67 recorder.canvas()->DrawColor(color_);
67 } 68 }
68 } 69 }
69 70
70 void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) override {} 71 void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) override {}
71 72
72 void OnDeviceScaleFactorChanged(float device_scale_factor) override {} 73 void OnDeviceScaleFactorChanged(float device_scale_factor) override {}
73 74
74 base::Closure PrepareForLayerBoundsChange() override { 75 base::Closure PrepareForLayerBoundsChange() override {
75 return base::Closure(); 76 return base::Closure();
76 } 77 }
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 ui::PrintLayerHierarchy(host->window()->layer(), gfx::Point(100, 100)); 365 ui::PrintLayerHierarchy(host->window()->layer(), gfx::Point(100, 100));
365 #endif 366 #endif
366 367
367 host->Show(); 368 host->Show();
368 base::MessageLoopForUI::current()->Run(); 369 base::MessageLoopForUI::current()->Run();
369 focus_client.reset(); 370 focus_client.reset();
370 host.reset(); 371 host.reset();
371 372
372 return 0; 373 return 0;
373 } 374 }
OLDNEW
« no previous file with comments | « no previous file | ui/aura/demo/demo_main.cc » ('j') | ui/aura/window_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698