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

Side by Side Diff: ui/views/view.h

Issue 1101783002: ui: Cache the output of View::OnPaint when the View isn't invalid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cache: . 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 | « ui/compositor/paint_recorder.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »
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 #ifndef UI_VIEWS_VIEW_H_ 5 #ifndef UI_VIEWS_VIEW_H_
6 #define UI_VIEWS_VIEW_H_ 6 #define UI_VIEWS_VIEW_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/i18n/rtl.h" 15 #include "base/i18n/rtl.h"
16 #include "base/logging.h" 16 #include "base/logging.h"
17 #include "base/memory/scoped_ptr.h" 17 #include "base/memory/scoped_ptr.h"
18 #include "build/build_config.h" 18 #include "build/build_config.h"
19 #include "ui/accessibility/ax_enums.h" 19 #include "ui/accessibility/ax_enums.h"
20 #include "ui/base/accelerators/accelerator.h" 20 #include "ui/base/accelerators/accelerator.h"
21 #include "ui/base/dragdrop/drag_drop_types.h" 21 #include "ui/base/dragdrop/drag_drop_types.h"
22 #include "ui/base/dragdrop/drop_target_event.h" 22 #include "ui/base/dragdrop/drop_target_event.h"
23 #include "ui/base/dragdrop/os_exchange_data.h" 23 #include "ui/base/dragdrop/os_exchange_data.h"
24 #include "ui/base/ui_base_types.h" 24 #include "ui/base/ui_base_types.h"
25 #include "ui/compositor/layer_delegate.h" 25 #include "ui/compositor/layer_delegate.h"
26 #include "ui/compositor/layer_owner.h" 26 #include "ui/compositor/layer_owner.h"
27 #include "ui/compositor/paint_cache.h"
27 #include "ui/events/event.h" 28 #include "ui/events/event.h"
28 #include "ui/events/event_target.h" 29 #include "ui/events/event_target.h"
29 #include "ui/gfx/geometry/insets.h" 30 #include "ui/gfx/geometry/insets.h"
30 #include "ui/gfx/geometry/rect.h" 31 #include "ui/gfx/geometry/rect.h"
31 #include "ui/gfx/geometry/vector2d.h" 32 #include "ui/gfx/geometry/vector2d.h"
32 #include "ui/gfx/native_widget_types.h" 33 #include "ui/gfx/native_widget_types.h"
33 #include "ui/views/view_targeter.h" 34 #include "ui/views/view_targeter.h"
34 #include "ui/views/views_export.h" 35 #include "ui/views/views_export.h"
35 36
36 #if defined(OS_WIN) 37 #if defined(OS_WIN)
(...skipping 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 bool snap_layer_to_pixel_boundary_; 1503 bool snap_layer_to_pixel_boundary_;
1503 1504
1504 // Painting ------------------------------------------------------------------ 1505 // Painting ------------------------------------------------------------------
1505 1506
1506 // Background 1507 // Background
1507 scoped_ptr<Background> background_; 1508 scoped_ptr<Background> background_;
1508 1509
1509 // Border. 1510 // Border.
1510 scoped_ptr<Border> border_; 1511 scoped_ptr<Border> border_;
1511 1512
1513 // Cached output of painting to be reused in future frames until invalidated.
1514 ui::PaintCache paint_cache_;
1515
1512 // RTL painting -------------------------------------------------------------- 1516 // RTL painting --------------------------------------------------------------
1513 1517
1514 // Indicates whether or not the gfx::Canvas object passed to View::Paint() 1518 // Indicates whether or not the gfx::Canvas object passed to View::Paint()
1515 // is going to be flipped horizontally (using the appropriate transform) on 1519 // is going to be flipped horizontally (using the appropriate transform) on
1516 // right-to-left locales for this View. 1520 // right-to-left locales for this View.
1517 bool flip_canvas_on_paint_for_rtl_ui_; 1521 bool flip_canvas_on_paint_for_rtl_ui_;
1518 1522
1519 // Accelerated painting ------------------------------------------------------ 1523 // Accelerated painting ------------------------------------------------------
1520 1524
1521 bool paint_to_layer_; 1525 bool paint_to_layer_;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1564 // Belongs to this view, but it's reference-counted on some platforms 1568 // Belongs to this view, but it's reference-counted on some platforms
1565 // so we can't use a scoped_ptr. It's dereferenced in the destructor. 1569 // so we can't use a scoped_ptr. It's dereferenced in the destructor.
1566 NativeViewAccessibility* native_view_accessibility_; 1570 NativeViewAccessibility* native_view_accessibility_;
1567 1571
1568 DISALLOW_COPY_AND_ASSIGN(View); 1572 DISALLOW_COPY_AND_ASSIGN(View);
1569 }; 1573 };
1570 1574
1571 } // namespace views 1575 } // namespace views
1572 1576
1573 #endif // UI_VIEWS_VIEW_H_ 1577 #endif // UI_VIEWS_VIEW_H_
OLDNEW
« no previous file with comments | « ui/compositor/paint_recorder.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698