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

Side by Side Diff: cc/resources/skpicture_content_layer_updater.h

Issue 315393002: Record SkPicture with correct LCD text setting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better unittest Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 CC_RESOURCES_SKPICTURE_CONTENT_LAYER_UPDATER_H_ 5 #ifndef CC_RESOURCES_SKPICTURE_CONTENT_LAYER_UPDATER_H_
6 #define CC_RESOURCES_SKPICTURE_CONTENT_LAYER_UPDATER_H_ 6 #define CC_RESOURCES_SKPICTURE_CONTENT_LAYER_UPDATER_H_
7 7
8 #include "cc/resources/content_layer_updater.h" 8 #include "cc/resources/content_layer_updater.h"
9 #include "skia/ext/refptr.h" 9 #include "skia/ext/refptr.h"
10 #include "third_party/skia/include/core/SkPicture.h" 10 #include "third_party/skia/include/core/SkPicture.h"
11 11
12 class SkCanvas; 12 class SkCanvas;
13 13
14 namespace cc { 14 namespace cc {
15 15
16 class LayerPainter;
17
18 // This class records the content_rect into an SkPicture. Subclass provides 16 // This class records the content_rect into an SkPicture. Subclass provides
19 // SkCanvas to DrawPicture() for tile updating based on this recorded picture. 17 // SkCanvas to DrawPicture() for tile updating based on this recorded picture.
20 class SkPictureContentLayerUpdater : public ContentLayerUpdater { 18 class SkPictureContentLayerUpdater : public ContentLayerUpdater {
21 protected: 19 protected:
22 SkPictureContentLayerUpdater( 20 SkPictureContentLayerUpdater(
23 scoped_ptr<LayerPainter> painter, 21 scoped_ptr<ContentLayerPainter> painter,
24 RenderingStatsInstrumentation* stats_instrumentation, 22 RenderingStatsInstrumentation* stats_instrumentation,
25 int layer_id); 23 int layer_id);
26 virtual ~SkPictureContentLayerUpdater(); 24 virtual ~SkPictureContentLayerUpdater();
27 25
28 virtual void PrepareToUpdate(const gfx::Rect& content_rect, 26 virtual void PrepareToUpdate(const gfx::Rect& content_rect,
29 const gfx::Size& tile_size, 27 const gfx::Size& tile_size,
30 float contents_width_scale, 28 float contents_width_scale,
31 float contents_height_scale, 29 float contents_height_scale,
32 gfx::Rect* resulting_opaque_rect) OVERRIDE; 30 gfx::Rect* resulting_opaque_rect) OVERRIDE;
33 void DrawPicture(SkCanvas* canvas); 31 void DrawPicture(SkCanvas* canvas);
34 32
35 private: 33 private:
36 skia::RefPtr<SkPicture> picture_; 34 skia::RefPtr<SkPicture> picture_;
37 35
38 DISALLOW_COPY_AND_ASSIGN(SkPictureContentLayerUpdater); 36 DISALLOW_COPY_AND_ASSIGN(SkPictureContentLayerUpdater);
39 }; 37 };
40 38
41 } // namespace cc 39 } // namespace cc
42 40
43 #endif // CC_RESOURCES_SKPICTURE_CONTENT_LAYER_UPDATER_H_ 41 #endif // CC_RESOURCES_SKPICTURE_CONTENT_LAYER_UPDATER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698