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

Unified Diff: ui/aura_shell/image_grid.h

Issue 8821028: aura: Draw shadows around tooltip windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: increase horizontal padding Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/aura_shell/image_grid.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/image_grid.h
diff --git a/ui/aura_shell/image_grid.h b/ui/aura_shell/image_grid.h
index a5ff264a33c8a1494aeed7959cc0cf6ae5d6b93c..892ab7f05cd1256b8abffe9db907a1e0d8cb00bf 100644
--- a/ui/aura_shell/image_grid.h
+++ b/ui/aura_shell/image_grid.h
@@ -78,6 +78,19 @@ class AURA_SHELL_EXPORT ImageGrid {
return grid_->bottom_right_layer_.get();
}
+ gfx::Rect top_left_clip_rect() const {
+ return grid_->top_left_painter_->clip_rect_;
+ }
+ gfx::Rect top_right_clip_rect() const {
+ return grid_->top_right_painter_->clip_rect_;
+ }
+ gfx::Rect bottom_left_clip_rect() const {
+ return grid_->bottom_left_painter_->clip_rect_;
+ }
+ gfx::Rect bottom_right_clip_rect() const {
+ return grid_->bottom_right_painter_->clip_rect_;
+ }
+
// Returns |layer|'s bounds after applying the layer's current transform.
gfx::Rect GetTransformedLayerBounds(const ui::Layer& layer);
@@ -117,18 +130,29 @@ class AURA_SHELL_EXPORT ImageGrid {
ImagePainter(const gfx::Image* image) : image_(image) {}
virtual ~ImagePainter() {}
+ // Clips |layer| to |clip_rect|. Triggers a repaint if the clipping
+ // rectangle has changed. An empty rectangle disables clipping.
+ void SetClipRect(const gfx::Rect& clip_rect, ui::Layer* layer);
+
// ui::LayerDelegate implementation:
virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE;
private:
+ friend class TestAPI;
+
const gfx::Image* image_; // not owned
+ gfx::Rect clip_rect_;
+
DISALLOW_COPY_AND_ASSIGN(ImagePainter);
};
// Returns the dimensions of |image| if non-NULL or gfx::Size(0, 0) otherwise.
static gfx::Size GetImageSize(const gfx::Image* image);
+ // Returns true if |layer|'s bounds don't fit within |size|.
+ static bool LayerExceedsSize(const ui::Layer* layer, const gfx::Size& size);
+
// Initializes |layer_ptr| and |painter_ptr| to display |image|.
// Also adds the passed-in layer to |layer_|.
void InitImage(const gfx::Image* image,
« no previous file with comments | « no previous file | ui/aura_shell/image_grid.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698