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

Unified Diff: runtime/embedders/openglui/common/canvas_context.h

Issue 13042015: Various OpenGLUI changes: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: runtime/embedders/openglui/common/canvas_context.h
===================================================================
--- runtime/embedders/openglui/common/canvas_context.h (revision 20570)
+++ runtime/embedders/openglui/common/canvas_context.h (working copy)
@@ -103,19 +103,9 @@
state_->setGlobalCompositeOperation(op);
}
- inline void Save() {
- state_ = state_->Save();
- }
+ void Save();
+ void Restore();
- inline void Restore() {
- CanvasState* popped_state = state_;
- state_ = state_->Restore();
- if (state_ != popped_state) {
- // Only delete if the pop was successful.
- delete popped_state;
- }
- }
-
inline void Rotate(float angle) {
canvas_->rotate(Radians2Degrees(angle));
}
@@ -306,6 +296,25 @@
virtual void Flush() {
canvas_->flush();
}
+
+ inline void SetFillGradient(bool is_radial, double x0, double y0, double r0,
+ double x1, double y1, double r1,
+ int stops, float* positions, char** colors) {
+ state_->SetFillGradient(is_radial, x0, y0, r0, x1, y1, r1,
+ stops, positions, colors);
+ }
+
+ inline void SetStrokeGradient(bool is_radial, double x0, double y0, double r0,
+ double x1, double y1, double r1,
+ int stops, float* positions, char** colors) {
+ state_->SetStrokeGradient(is_radial, x0, y0, r0, x1, y1, r1,
+ stops, positions, colors);
+ }
+
+ inline const SkBitmap* GetBitmap() {
+ SkDevice* device = canvas_->getDevice();
+ return &device->accessBitmap(false);
+ }
};
CanvasContext* Context2D(int handle);

Powered by Google App Engine
This is Rietveld 408576698